File

src/app/modules/telemetry/directives/telemetry-start/telemetry-start.directive.ts

Description

TelemetryInteract Directive

Implements

OnChanges

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(telemetryService: TelemetryService)

Constructor to create injected service(s) object Default method of Draft Component class

Parameters :
Name Type Optional Description
telemetryService TelemetryService No

Reference of TelemetryService

Inputs

appTelemetryStart
Type : IStartEventInput

Interact event input

Methods

ngOnChanges
ngOnChanges()
Returns : void

Properties

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);
    }
  }
}

results matching ""

    No results matching ""