Created
January 4, 2019 19:37
-
-
Save NishuGoel/3d0ab2c95ad900cd7a8f846e6d4b94db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { Observable } from 'rxjs/Observable'; | |
import { AngularFirestore } from 'angularfire2/firestore'; | |
@Component({ | |
selector: 'app-root', | |
template: ` | |
<ul> | |
<li *ngFor="let d of data | async"> | |
<pre>{{ d | json }}</pre> | |
</li> | |
</ul> | |
` | |
}) | |
export class AppComponent { | |
public data: Observable<any[]>; | |
constructor(db: AngularFirestore) { | |
this.data = db.collection('/data').valueChanges(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment