This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
hierarchical-dependency-injection/ts/app Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ import { Hero } from './hero';
21
21
} )
22
22
23
23
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 > ( ) ;
26
26
27
27
constructor ( private restoreService : RestoreService < Hero > ) { }
28
28
@@ -36,12 +36,12 @@ export class HeroEditorComponent {
36
36
}
37
37
38
38
onSaved ( ) {
39
- this . saved . next ( this . restoreService . getItem ( ) ) ;
39
+ this . saved . emit ( this . restoreService . getItem ( ) ) ;
40
40
}
41
41
42
42
onCanceled ( ) {
43
43
this . hero = this . restoreService . restoreItem ( ) ;
44
- this . canceled . next ( this . hero ) ;
44
+ this . canceled . emit ( this . hero ) ;
45
45
}
46
46
}
47
47
// #enddocregion
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export class TodoFormComponent {
17
17
18
18
addTodo ( ) {
19
19
if ( this . task ) {
20
- this . newTask . next ( { text : this . task , done : false } ) ;
20
+ this . newTask . emit ( { text : this . task , done : false } ) ;
21
21
}
22
22
this . task = '' ;
23
23
}
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ export class InputComponent {
152
152
// selector: 'input[value]',
153
153
// host: {
154
154
// '[value]': 'value',
155
- // '(input)': 'valueChange.next ($event.target.value)'
155
+ // '(input)': 'valueChange.emit ($event.target.value)'
156
156
// },
157
157
// inputs: ['value'],
158
158
// outputs: ['valueChange']
@@ -173,7 +173,7 @@ export class InputValueBinderDirective {
173
173
valueChange : EventEmitter < any > = new EventEmitter ( ) ;
174
174
175
175
@HostListener ( 'input' , [ '$event.target.value' ] )
176
- onInput ( value : any ) { this . valueChange . next ( value ) ; }
176
+ onInput ( value : any ) { this . valueChange . emit ( value ) ; }
177
177
}
178
178
179
179
@Component ( {
Original file line number Diff line number Diff line change @@ -13,6 +13,6 @@ import { Hero } from '../model';
13
13
export class DashboardHeroComponent {
14
14
@Input ( ) hero : Hero ;
15
15
@Output ( ) selected = new EventEmitter < Hero > ( ) ;
16
- click ( ) { this . selected . next ( this . hero ) ; }
16
+ click ( ) { this . selected . emit ( this . hero ) ; }
17
17
}
18
18
// #enddocregion component
You can’t perform that action at this time.
0 commit comments