Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

observables loop in template angular 8

//.ts file
ngOnInit(): void {
   this.pageData=this.service.getdata('/about_us_page/');  
}

//.service file
                           
getdata(tableName:string){

    return this.db.list(tableName).snapshotChanges().pipe(map(changes => {

      return changes.map(c => ({ key: c.payload.key, data:c.payload.val() }) )  }));
    //return this.db.list(tableName);
  }
             
//.html file
<ul class=""  scope="row" *ngFor="let aboutus of this.pageData |async " >             
		<li>{{aboutus.key}} {{aboutus.data.details}} </li>                               
 </ul>
Comment

PREVIOUS NEXT
Code Example
Javascript :: Using Intl.NumberFormat() to Print JavaScript Number Format with Commas 
Javascript :: JavaScript Normalized and UnNnormalized URL 
Javascript :: Example of AggregateError in es12 
Javascript :: Mapping page number to index 
Javascript :: Example code of using inner blocks in Wordpress with ESNext 
Javascript :: Template literals in ES6 Syntax Concatenation 
Javascript :: How to get element margin in React 
Javascript :: js date add days daylight saving 
Javascript :: format file using jq 
Javascript :: convert java object to json 
Javascript :: vuejs jitsi 
Javascript :: Parents, Children & Siblings 
Javascript :: change user agent in playwright 
Javascript :: discord-buttons collector 
Javascript :: set state giving previously update data 
Javascript :: convert an array to other array 
Javascript :: netlify not deploying react site 
Javascript :: node fs stream pipe promise 
Javascript :: react native charts style gradiant 
Javascript :: disable pdf download javascript 
Javascript :: AJAX XML - update new live data and prevent returning old chache data 
Javascript :: js function to print words on number 
Javascript :: map vs subscribe angular 
Javascript :: salt has the same key in accepted and denied 
Javascript :: electron frameless Draggable move 
Javascript :: ProMrRadel2 
Javascript :: convert jquery hide function to pure javascript code 
Javascript :: react-native-calendars how to mark selected day 
Javascript :: material ui css supports 
Javascript :: puppeeter pdf desktop 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =