Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

AngularFire

import { Firestore, collectionData, collection } from '@angular/fire/firestore';
import { Observable } from 'rxjs';

interface Item {
  name: string,
  ...
};

@Component({
  selector: 'app-root',
  template: `
  <ul>
    <li *ngFor="let item of item$ | async">
      {{ item.name }}
    </li>
  </ul>
  `
})
export class AppComponent {
  item$: Observable<Item[]>;
  constructor(firestore: Firestore) {
    const collection = collection(firestore, 'items');
    this.item$ = collectionData(collection);
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript call example 
Javascript :: nested object 
Javascript :: capitalize last letter javascript 
Javascript :: reverse an array in javascript 
Javascript :: javascript hover event listener 
Javascript :: menu with dynamic submenu in javascript 
Javascript :: react native extract cookie from response 
Javascript :: canvas squashed video javascript 
Javascript :: ArrayReplace 
Javascript :: suscribe messagechannel lwc 
Javascript :: find symmetrical difference of arrays 
Javascript :: load content on user language in javascript 
Javascript :: wordpress how to read jquery 
Javascript :: get time in between two dates javascript dayjs 
Javascript :: how to find the GCD in javascript 
Javascript :: html5 javascript json vertical colom grap 
Javascript :: absolute item onPress ToucableOpacity problem 
Javascript :: Laravel Vue.js API: axios, FormData() is empty 
Javascript :: Angular /Javascript- How can I shrink Sticky header on scroll functionality 
Javascript :: node js delete folder 
Javascript :: directive with ng-if not rendering in Angular.js 
Javascript :: createaction ngrx example 
Javascript :: Using useEffect with async 
Javascript :: mutexify 
Javascript :: vue custom event validation 
Javascript :: select the value of dropdownMenu with Semantic ui react 
Javascript :: javascript loop through collection of objects 
Javascript :: Create A Class Using JavaScript 
Javascript :: vimscript replace function 
Javascript :: select next occurrence visual studio 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =