// FIXME: it would be cleaner if we could somehow use
// the per-IDL-class ng-templates directly
switch (this.idlClass) {
+ case 'acmc':
+ return fm.course_number() + ': ' + fm.name();
+ break;
case 'acqf':
return fm.code() + ' (' + fm.year() + ')';
break;
<ng-template #idlClassLabel let-r="result" i18n>
{{r.label}}
</ng-template>
+<ng-template #acmcTemplate
+ let-field="field" let-record="record">
+ <eg-combobox idlClass="acmc" [required]="true"
+ [selectedId]="record['course']()"
+ (onChange)="($event) ? record['course']($event.id) : ''">
+ </eg-combobox>
+</ng-template>
<ng-container *ngIf="!isDialog()">
<!-- in "inline" mode, render the grid pane right here -->
</ng-container>
</ng-container>
-<eg-fm-record-editor #editDialog idlClass='acmcm' [fieldOptions]="{course: {linkedSearchField: 'course_number'}}"
+<eg-fm-record-editor #editDialog idlClass='acmcm' [fieldOptions]="{course: {customTemplate:{template:acmcTemplate}}}"
[preloadLinkedValues]="true"
hiddenFields="id,item,original_callnumber,original_status,original_location,original_circ_modifier,record,temporary_record">
</eg-fm-record-editor>