File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ itemsRef.remove();
202
202
203
203
``` ts
204
204
import { Component } from ' @angular/core' ;
205
- import { AngularFireDatabase } from ' angularfire2/database' ;
205
+ import { AngularFireDatabase , AngularFireList } from ' angularfire2/database' ;
206
206
import { Observable } from ' rxjs/Observable' ;
207
207
208
208
@Component ({
@@ -221,9 +221,11 @@ import { Observable } from 'rxjs/Observable';
221
221
` ,
222
222
})
223
223
export class AppComponent {
224
- itemsRef: Observable <any []>;
224
+ itemsRef: AngularFireList <any >;
225
+ items: Observable <any []>;
225
226
constructor (db : AngularFireDatabase ) {
226
- this .itemsRef = db .list (' messages' ).valueChanges ();
227
+ this .itemsRef = db .list (' messages' );
228
+ this .items = this .itemsRef .valueChanges ();
227
229
}
228
230
addItem(newName : string ) {
229
231
this .itemsRef .push ({ text: newName });
You can’t perform that action at this time.
0 commit comments