File

src/lib/services/defaultButtonService/default-button.service.ts

Description

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

Index

Properties
Methods
Accessors

Methods

notifyClick
notifyClick(event: EventData)

Notifies the click to the subscribed control

Parameters :
Name Type Optional
event EventData No
Returns : void

Properties

Private clickEmitted
Type : Subject<EventData>
Default value : new Subject<EventData>()

The click emitted subject

Accessors

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

results matching ""

    No results matching ""