Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit fea03ea

Browse files
rexebinwardbell
authored andcommitted
Replace next() with emit() for EventEmitter<T> (#2812)
1 parent 199d209 commit fea03ea

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

public/docs/_examples/hierarchical-dependency-injection/ts/app/hero-editor.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import { Hero } from './hero';
2121
})
2222

2323
export class HeroEditorComponent {
24-
@Output() canceled = new EventEmitter();
25-
@Output() saved = new EventEmitter();
24+
@Output() canceled = new EventEmitter<Hero>();
25+
@Output() saved = new EventEmitter<Hero>();
2626

2727
constructor(private restoreService: RestoreService<Hero>) {}
2828

@@ -36,12 +36,12 @@ export class HeroEditorComponent {
3636
}
3737

3838
onSaved () {
39-
this.saved.next(this.restoreService.getItem());
39+
this.saved.emit(this.restoreService.getItem());
4040
}
4141

4242
onCanceled () {
4343
this.hero = this.restoreService.restoreItem();
44-
this.canceled.next(this.hero);
44+
this.canceled.emit(this.hero);
4545
}
4646
}
4747
// #enddocregion

public/docs/_examples/homepage-todo/ts/app/todo_form.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class TodoFormComponent {
1717

1818
addTodo() {
1919
if (this.task) {
20-
this.newTask.next({text: this.task, done: false});
20+
this.newTask.emit({text: this.task, done: false});
2121
}
2222
this.task = '';
2323
}

public/docs/_examples/testing/ts/app/bag/bag.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export class InputComponent {
152152
// selector: 'input[value]',
153153
// host: {
154154
// '[value]': 'value',
155-
// '(input)': 'valueChange.next($event.target.value)'
155+
// '(input)': 'valueChange.emit($event.target.value)'
156156
// },
157157
// inputs: ['value'],
158158
// outputs: ['valueChange']
@@ -173,7 +173,7 @@ export class InputValueBinderDirective {
173173
valueChange: EventEmitter<any> = new EventEmitter();
174174

175175
@HostListener('input', ['$event.target.value'])
176-
onInput(value: any) { this.valueChange.next(value); }
176+
onInput(value: any) { this.valueChange.emit(value); }
177177
}
178178

179179
@Component({

public/docs/_examples/testing/ts/app/dashboard/dashboard-hero.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ import { Hero } from '../model';
1313
export class DashboardHeroComponent {
1414
@Input() hero: Hero;
1515
@Output() selected = new EventEmitter<Hero>();
16-
click() { this.selected.next(this.hero); }
16+
click() { this.selected.emit(this.hero); }
1717
}
1818
// #enddocregion component

0 commit comments

Comments
 (0)