src/app/modules/telemetry/directives/telemetry-start/telemetry-start.directive.ts
TelemetryInteract Directive
OnChanges
Selector | [appTelemetryStart] |
Properties |
|
Methods |
Inputs |
constructor(telemetryService: TelemetryService)
|
||||||||
Constructor to create injected service(s) object Default method of Draft Component class
Parameters :
|
appTelemetryStart | |
Type : IStartEventInput
|
|
Interact event input |
ngOnChanges |
ngOnChanges()
|
Returns :
void
|
Public eventTriggered |
Default value : false
|
Public telemetryService |
Type : TelemetryService
|
reference of permissionService service. |
import { Directive, Input, OnChanges } from '@angular/core';
import { IStartEventInput } from '../../interfaces';
import { TelemetryService } from '../../services';
/**
* TelemetryInteract Directive
*/
@Directive({
selector: '[appTelemetryStart]'
})
export class TelemetryStartDirective implements OnChanges {
/**
* Interact event input
*/
@Input() appTelemetryStart: IStartEventInput;
/**
* reference of permissionService service.
*/
public telemetryService: TelemetryService;
public eventTriggered = false;
/**
* 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.appTelemetryStart && !this.eventTriggered) {
this.eventTriggered = true;
this.telemetryService.start(this.appTelemetryStart);
}
}
}