I have a rather simple query: I have a TypeScript Object in JSON format, and I want to iterate through its properties.
{"work_type":"Fabricación","work_type_resp":"Mesa","looking_for":"Relación Calidad/Precio","image":"https://s3-sa-east-1.amazonaws.com/online-quotation-images/153366018967.png","width":"22","high":"34","depth":"","modifications":"mod"}
The Angular TypeScript component code that I am using is as follows:
export class DetailsOnlineQuoteModalComponent implements OnInit {
@Input() title;
@Input() values:string;
properties:JSON;
constructor(public activeModal: NgbActiveModal) { }
ngOnInit() {
this.properties=JSON.parse(this.values);
console.log(this.properties);
}
}
My ultimate goal here is to access the key-value pairs within the JSON object and display them in my HTML file.
Thanks a bunch!