Hi guys I'm working on Angular application and I would like some help to fetch the data from the json. I've got my conpoments.ts with my method but it is not working. I included the json file. please help me to display the data on html page.Thank you
label: "car"
manufacture:Array(3)
{id: "1", label: "name", question: "", type: "type", value: {…}}
{id: "2", label: "name", question: "", type: "type", value: {…}}
{id: "3", label: "name", question: "", type: "type", value: {…}}
import { Component, OnInit } from '@angular/core';
import { ManufactureService } from '../../services/ManufactureService/manufacture.service';
@Component({
selector: 'body-content',
templateUrl: './body.component.html',
styleUrls: ['./body.component.less']
})
export class BodyComponent implements OnInit {
constructor(public
manufactureService:ManufactureService) { }
async ngOnInit() {
const [err,data] = await this. manufactureService.getManufature('car','man').toPromise()
if (err) {
console.log(err)
return false
}
showCar(data){
data.forEach(el=>{
this.manufactureService.getManufature.push();
})
}
}
}