src/app/modules/telemetry/directives/telemetry-error/telemetry-error.directive.ts
TelemetryInteract Directive
OnChanges
Selector | [appTelemetryError] |
Properties |
|
Methods |
Inputs |
constructor(telemetryService: TelemetryService)
|
||||||||
Constructor to create injected service(s) object Default method of Draft Component class
Parameters :
|
appTelemetryError | |
Type : IErrorEventInput
|
|
Interact event input |
ngOnChanges |
ngOnChanges()
|
Returns :
void
|
Public telemetryService |
Type : TelemetryService
|
reference of permissionService service. |
import { Directive, Input, OnChanges } from '@angular/core';
import { IErrorEventInput } from '../../interfaces';
import { TelemetryService } from '../../services';
/**
* TelemetryInteract Directive
*/
@Directive({
selector: '[appTelemetryError]'
})
export class TelemetryErrorDirective implements OnChanges {
/**
* Interact event input
*/
@Input() appTelemetryError: IErrorEventInput;
/**
* reference of permissionService service.
*/
public telemetryService: TelemetryService;
/**
* Constructor to create injected service(s) object
Default method of Draft Component class
* @param {TelemetryService} telemetryService Reference of TelemetryService
*/
constructor(telemetryService: TelemetryService) {
this.telemetryService = telemetryService;
}
ngOnChanges() {
if (this.appTelemetryError) {
this.telemetryService.error(this.appTelemetryError);
}
}
}