From cdb35a258d9a7850b8de6f5c25419d98dde5ca3f Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Tue, 26 Mar 2019 17:51:54 -0700 Subject: [PATCH] fixing lifecycle issue --- .../staff/booking/create-reservation.component.ts | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts index c42558f677..f2da2d14ad 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts @@ -29,8 +29,6 @@ export class CreateReservationComponent implements OnInit { scheduleSource: GridDataSource = new GridDataSource(); - handleResourceTypeChange: ($event: ComboboxEntry) => void; - resources: IdlObject[] = []; limitByAttr: (attributeId: number, $event: ComboboxEntry) => void; @@ -101,19 +99,6 @@ export class CreateReservationComponent implements OnInit { console.log('event: ' + JSON.stringify($event)); }; - this.handleResourceTypeChange = ($event: ComboboxEntry) => { - // TODO: unset resource barcode - this.attributes = []; - if ($event.id) { - this.pcrud.search('bra', {resource_type : $event.id}, { - order_by: 'name ASC', - flesh: 1, - flesh_fields: {'bra' : ['valid_values']} - }).subscribe( - a => { this.attributes.push(a); }); - this.fetchData('type', $event.id); - } - }; } showNewDialog(idlThing: IdlObject) { @@ -125,6 +110,21 @@ export class CreateReservationComponent implements OnInit { err => {} ); } + + this.handleResourceTypeChange($event: ComboboxEntry) { + // TODO: unset resource barcode + this.attributes = []; + if ($event.id) { + this.pcrud.search('bra', {resource_type : $event.id}, { + order_by: 'name ASC', + flesh: 1, + flesh_fields: {'bra' : ['valid_values']} + }).subscribe( + a => { this.attributes.push(a); }); + this.fetchData('type', $event.id); + } + } + private _firstTimeIsSmaller(first: NgbTimeStruct, second: NgbTimeStruct) { if (first.hour < second.hour) { return true; } if ((first.hour === second.hour) && (first.minute < second.minute)) { return true; } -- 2.11.0