Answers for "angular html print json object"

0

show json data in html angular

<!--JSON data in the ts component:-->
data = [
  {
    title: 'Title 1',
    content: 'Lorem ipsum'
  },
  {
    title: 'Title 2',
    content: 'Lorem ipsum2'
  }
]

<!--In the HTML component:-->
<div *ngFor="let dat of data">
  <h1>{{dat.title}}</h1>
  <p>{{dat.content}}</p>
</div>
Posted by: Guest on October-26-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language