当我尝试基于id更新数据时,无法迭代表单字段中的数据,请查看屏幕截图以了解更多详细信息
错误预览
要遍历ngFor,数据必须是数组的形式
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"}];
}