Skip to content

Instantly share code, notes, and snippets.

@NishuGoel
Created January 4, 2019 19:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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