src/lib/services/internalEventHandler/internal-event-handler.service.ts
Service to handle internal events between a Control and its internal controls.
Properties |
|
Methods |
Accessors |
onButtonClickEmit | ||||||
onButtonClickEmit(event: any)
|
||||||
Emits the onButtonClick action.
Parameters :
Returns :
void
|
Private onButtonClickAction |
Type : Subject<any>
|
Default value : new Subject<any>()
|
OnButtonClick action property. |
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);
}
}