"url" : "https://reqres.in/api/users?page=2",
"method" : "GET",
"authorization" : null,
"headers" : "[{\"key\":\"wrtwrt\",\"value\":\"wrtwr\"}]",
"body" : ",[{\"key\":\"\",\"value\":\"\"}]",
"urlType" : "PULLEXPENSE",
"createdBy" : {
"id" : 3,
"userName" : "ecapp@ofs.com",
"password" : "",
"firstName" : "Company",
"lastName" : "Admin",
"emailId" : "ecapp@ofs.com",
"company" : {
"companyId" : 1,
"name" : "Zirius",
"currency" : {
"currencyId" : 1,
"name" : "Norwegian krone",
"abbrevition" : "NOK"
},
"language" : {
"languageId" : 2,
"name" : "Norwegian"
},
onAccordionPullOpen(){
this.service.getPullApiConfiguration(this.userinfo.company.companyId)
.subscribe((data) =>{
console.log("successs login"+JSON.stringify(data));
var headersplash = data[0].headers;
headersplash = headersplash.replace(/\//g, " ");
this.apiconfiguration.key = data[0].headers;
this.apiconfiguration.value = data[0].headers;
},(err) =>{
console.log("er occured")
})
}
<input mdInput type="text" [(ngModel)]="apiconfiguration.key"
name="key" id="key" class="form-control" formControlName="key" >
In the below json headers has another array I am trying to get the data from headers array like data[0].headers.key but I am unable to get the key value. slashes has to remove in the headers.