@@ -10,23 +10,27 @@ The guide below demonstrates how to retrieve, save, and remove data as objects.
1010
1111AngularFire is an injectable service, which is injected through the constructor of your Angular component or ` @Injectable() `  service.
1212
13+ If you've followed the earlier step "Installation and Setup"  your ` /src/app/app.component.ts `  should look like below. 
14+ 
1315``` ts 
1416import  { Component  } from  ' @angular/core' 
15- import  { AngularFire  } from  ' angularfire2' 
17+ import  { AngularFire ,  FirebaseListObservable  } from  ' angularfire2' 
1618
1719@Component ({
18-   moduleId: module .id ,
19-   selector: ' app' 
20-   template: ' app.component.html' 
20+   selector: ' app-root' 
21+   templateUrl: ' app.component.html' 
2122  styleUrls: [' app.component.css' 
2223})
2324export  class  AppComponent  {
25+   items:  FirebaseListObservable <any []>;
2426  constructor (af :  AngularFire ) {
25-     
27+     this . items   =   af . database . list ( ' items ' ); 
2628  }
2729}
2830``` 
2931
32+ In this section, we're going to modify the ` /src/app/app.component.ts `   to retreive data as object.
33+ 
3034## Create an object binding  
3135
3236Data is retrieved through the ` af.database `  service.
@@ -48,12 +52,15 @@ const absolute = af.database.object('https://<your-app>.firebaseio.com/item');
4852To get the object in realtime, create an object binding as a property of your component or service.
4953Then in your template, you can use the ` async `  pipe to unwrap the binding.
5054
55+ Replace the FirebaseListObservable to FirebaseObjectObservable in your ` /src/app/app.component.ts `  as below.
56+ Also notice the templateUrl changed to inline template below:
57+ 
5158``` ts 
52- import  {Component } from  ' angular2 /core' 
59+ import  {Component } from  ' @angular /core' 
5360import  {AngularFire , FirebaseObjectObservable } from  ' angularfire2' 
5461
5562@Component ({
56-   selector: ' app' 
63+   selector: ' app-root ' 
5764  template: ` 
5865  <h1>{{ (item | async)?.name }}</h1> 
5966   ` ,
@@ -129,8 +136,7 @@ import { Component } from '@angular/core';
129136import  { AngularFire , FirebaseObjectObservable  } from  ' angularfire2' 
130137
131138@Component ({
132-   moduleId: module .id ,
133-   selector: ' app' 
139+   selector: ' app-root' 
134140  template: ` 
135141  <h1>{{ item | async | json }}</h1> 
136142  <input type="text" #newname placeholder="Name" /> 
@@ -141,7 +147,7 @@ import { AngularFire, FirebaseObjectObservable } from 'angularfire2';
141147  <button (click)="delete()">Delete</button> 
142148   ` ,
143149})
144- export  class  RcTestAppComponent  {
150+ export  class  AppComponent  {
145151  item:  FirebaseObjectObservable <any >;
146152  constructor (af :  AngularFire ) {
147153    this .item  =  af .database .object (' /item' 
0 commit comments