File

src/lib/services/internalEventHandler/internal-event-handler.service.ts

Description

Service to handle internal events between a Control and its internal controls.

Index

Properties
Methods
Accessors

Methods

onButtonClickEmit
onButtonClickEmit(event: any)

Emits the onButtonClick action.

Parameters :
Name Type Optional
event any No
Returns : void

Properties

Private onButtonClickAction
Type : Subject<any>
Default value : new Subject<any>()

OnButtonClick action property.

Accessors

onButtonClick
getonButtonClick()

Gets the onButtonClick action.

Returns : Observable<any>
import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';

/**
 * Service to handle internal events between a Control and its internal controls.
 *
 * @export
 * @class InternalEventHandlerService
 */
@Injectable()
export class InternalEventHandlerService {
  /**
   * OnButtonClick action property.
   *
   * @private
   * @type {Subject<any>}
   * @memberof InternalEventHandlerService
   */
  private onButtonClickAction: Subject<any> = new Subject<any>();

  /**
   * Gets the onButtonClick action.
   *
   * @readonly
   * @type {Observable<any>}
   * @memberof InternalEventHandlerService
   */
  get onButtonClick(): Observable<any> {
    return this.onButtonClickAction.asObservable();
  }

  /**
   * Emits the onButtonClick action.
   *
   * @param {*} event
   * @memberof InternalEventHandlerService
   */
  onButtonClickEmit(event: any): void {
    this.onButtonClickAction.next(event);
  }
}

results matching ""

    No results matching ""