when I try to update data based on the id unable to iterate data in form fields, please find the screenshots for more details
0
votes
1 Answers
1
votes
to iterate through ngFor data must be in form of an array
html.component.html
<div *ngFor = "let title of fetchData">
{{title.title}} -- {{title.description}} -- {{title.tagline}} {{title.date}}
</div>
html.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
fetchData = [{"title":"saurabh","description":"dd","tagline":"tt","date":"dd"},{"title":"aman","description":"dd","tagline":"tt","date":"dd"},{"title":"jessica","description":"dd","tagline":"tt","date":"dd"},{"title":"rosh","description":"dd","tagline":"tt","date":"dd"}];
}