Hi I want to convert the RestController Response which is in Json String to json array here is my json array sting which i have printed in console.
'{"Impressions":["Budget","CTR","Campaign","Campaign state","Clicks","Conv. rate"],"Clicks":["Budget","CTR","Campaign","Campaign state","Clicks","Conv. rate"],"Revenue":["Budget","CTR","Campaign","Campaign state","Clicks","Conv. rate"]}'
I want to convert it to json array so that i can iterate it,
My requirement is to iterate the array and print key as label and value as slect options
Example:
Impression as label and "Budget","CTR","Campaign","Campaign state","Clicks","Conv. rate" as select options.
Here is my code for iteration
<div>
<form *ngFor ="let map of mapper">
<mat-form-field>
<mat-select placeholder="{{map}}">
<!--<mat-option>None</mat-option>-->
<mat-option *ngFor="let option of map" [value]="option">
{{option}}
</mat-option>
</mat-select>
</mat-form-field>
</form>
</div>
my .ts class
this.clientService.getHeaders().subscribe(
(res) => {
console.log(res);
let resSTR = JSON.stringify(res);
let resJSON = JSON.parse(resSTR);
this.mapper=Array.of(resJSON._body);
console.log(this.mapper);
this.ismapped=false;
}
);