EventEmitter

EventEmitter

Stable Class

Class Overview

class EventEmitter extends Subject {
  constructor(isAsync?: boolean)
  
  
  emit(value?: T)
  subscribe(generatorOrNext?: any, error?: any, complete?: any) : any
}

Class Description

Use by directives and components to emit custom Events.

Examples

In the following example, Zippy alternatively emits open and close events when its title gets clicked:

@Component({
  selector: 'zippy',
  template: `
  <div class="zippy">
    <div (click)="toggle()">To