Skip to content
Snippets Groups Projects
Commit 29966147 authored by OZGCloud's avatar OZGCloud
Browse files

Changed to subject

parent 1e3f1e2d
No related branches found
No related tags found
No related merge requests found
import {EventEmitter, Injectable} from '@angular/core';
import {Injectable} from '@angular/core';
import {Subject} from "rxjs";
@Injectable({
providedIn: 'root'
})
export class DemoPresenter {
readonly update = new EventEmitter<{index: number, value: number}>;
readonly update = new Subject<{index: number, value: number}>;
public handleClick(index: number, value: number) {
// presenter handle user interaction
// and decide what to do with the event
this.update.emit({index: index, value: ++value});
this.update.next({index: index, value: ++value});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment