import { DataService } from 'src/app/services/data.service' ; import { Injector , Directive } from '@angular/core' ; import { IResponseMessageHandler } from 'src/app/Common/ResponseMessageHandlers' ; import { Observable } from 'rxjs' ; import { map , mergeMap } from 'rxjs/operators' ; import { ActivatedRouteSnapshot } from '@angular/router' ; import { IdUtils } from 'src/app/Utils/IdUtils' ; import { BaseControllerDirective } from 'src/app/ViewModels/BaseController' ; import { ApplicationTypeGroup } from 'src/app/Models/DataModels/ApplicationType' ; @ Directive ( ) export class ApplicationTypeBaseControllerDirective extends BaseControllerDirective { appTypeName : string ; appTypeGroup : ApplicationTypeGroup ; constructor ( protected data , injector ) { super ( injector ) ; } common ( messageHandler ? ) { return this . data . getAppTypeGroup ( this . appTypeName , true , messageHandler ) . pipe ( map ( appTypeGroup => { this . appTypeGroup = appTypeGroup ; } ) ) ; } getParams ( route ) { this . appTypeName = IdUtils . getAppTypeName ( route ) ; } }