File

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

Description

TelemetryInteract Directive

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(telemetryService: TelemetryService, activatedRoute: ActivatedRoute)

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

Parameters :
Name Type Optional Description
telemetryService TelemetryService No

Reference of TelemetryService

activatedRoute ActivatedRoute No

Inputs

TelemetryShareEdata
Type : IShareEventData

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

appTelemetryShare
Type : IShareEventInput

Interact event input

Public telemetryService
Type : TelemetryService

reference of permissionService service.

import { Directive, Input, OnInit } from '@angular/core';
import { IShareEventInput, IShareEventData } from '../../interfaces';
import { TelemetryService } from '../../services';
import { ActivatedRoute } from '@angular/router';
/**
 * TelemetryInteract Directive
 */
@Directive({
  selector: '[appTelemetryShare]'
})
export class TelemetryShareDirective implements OnInit {
  /**
   * Interact event input
  */
  appTelemetryShare: IShareEventInput;

  @Input() TelemetryShareEdata: IShareEventData;
  /**
   * 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, private activatedRoute: ActivatedRoute) {
    this.telemetryService = telemetryService;
  }
  ngOnInit() {
    if (this.TelemetryShareEdata) {
      this.appTelemetryShare = {
        context: {
          env: this.activatedRoute.snapshot.data.telemetry.env
        },
        edata: this.TelemetryShareEdata
      };
      this.telemetryService.share(this.appTelemetryShare);
    }
  }
}

results matching ""

    No results matching ""