Last active
February 22, 2020 15:53
-
-
Save vijayksingh/5f0f148414e8e99962dd9be1b46c6349 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit, ChangeDetectionStrategy, Input } from '@angular/core'; | |
import { BaseGraphqlService } from '@otalio/modules'; | |
import { DatePipe } from '@angular/common'; | |
import { MaintenenceRequestsApiService, MaintenenceRequestDto } from '@otalio/api'; | |
import { ServiceItemsTreeStructureService } from '../../services/service-items-tree-structure.service'; | |
import { Observable } from 'rxjs'; | |
import { MenuTreeItem } from '@otalio/components'; | |
import { ServiceRequestsTreeSelected } from '../service-requests-tree/entities/service-requests-tree-selected'; | |
@Component({ | |
selector: 'otalio-service-request-maintenance-tree', | |
changeDetection: ChangeDetectionStrategy.OnPush, | |
viewProviders: [DatePipe], | |
template: ` | |
<otalio-menu-tree-list | |
[selected]="selectedSubject | async" | |
[primaryItems]="primaryItemsSubject | async" | |
[secondaryItemsMap]="secondaryItemsMapSubject | async" | |
(selectEvent)="onSelect($event)" | |
></otalio-menu-tree-list> | |
`, | |
}) | |
export class ServiceRequestMaintenanceTreeComponent implements OnInit { | |
@Input() set selected(selected: ServiceRequestsTreeSelected) { | |
if (selected) { | |
this.setSelected(selected); | |
} | |
} | |
maintenanceItemSubject: Observable<MenuTreeItem[]>; | |
ngOnInit(): void { | |
this.initListeners(); | |
} | |
private initListeners(): void { | |
this.maintenanceItemSubject = this.serviceItemsTreeStructureService.listenMaintenanceServiceItemChange(); | |
} | |
private load(reqIds: string): void { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment