src/lib/services/defaultButtonService/default-button.service.ts
Service to handle DefaultButton events between a Control and its internal controls.
Properties |
|
Methods |
Accessors |
notifyClick | ||||||
notifyClick(event: EventData)
|
||||||
Notifies the click to the subscribed control
Parameters :
Returns :
void
|
Private clickEmitted |
Type : Subject<EventData>
|
Default value : new Subject<EventData>()
|
The click emitted subject |
ClickEmittedNotification |
getClickEmittedNotification()
|
Gets the notification for the click emit
Returns :
Observable<EventData>
|
import { EventData } from '@mobilize/base-components';
import { Observable, Subject } from 'rxjs';
import { Injectable } from '@angular/core';
/**
* Service to handle DefaultButton events between a Control and its internal controls.
*
* @export
* @class DefaultButtonService
*/
@Injectable()
export class DefaultButtonService {
/**
* The click emitted subject
*
* @private
* @type {Subject<EventData>}
* @memberof AjaxInteractionService
*/
private clickEmitted: Subject<EventData> = new Subject<EventData>();
/**
* Gets the notification for the click emit
*
* @readonly
* @type {Observable<EventData>}
* @memberof AjaxInteractionService
*/
get ClickEmittedNotification(): Observable<EventData> {
return this.clickEmitted.asObservable();
}
/**
* Notifies the click to the subscribed control
*
* @param {EventData} event
* @memberof AjaxInteractionService
*/
notifyClick(event: EventData): void {
this.clickEmitted.next(event);
}
}