I have my data binding which is coming in from a web API and I am binding that to my view, however one field is causing a problem because it has a dot in the middle of the name desc_ci.serial_number, I am trying the following code so far:
API data structure from API
desc_ci.serial_number: "cxxxxxxxx"
description: ""
etc etc
html
<span class="text-gray">{{receivedIncident.desc_ci.serial_number}}</span>
.ts file
receivedIncident: any;
constructor(private service: nowService,
private appComponent: AppComponent,
private userService: UserService,
private router: Router,
private http: HttpClient,
private route: ActivatedRoute
) {
this.receivedIncident = { number: '', opened_at: '', description: '', short_description: '', desc_ci.serial_number: ''}; this.receivedLocation = {city:null, country: null}
}
private getIncident() {
this.service.getIncident(this.s_id, this.c_id).subscribe((data) => {
this.loading = true;
console.log('Result - ', data);
console.log('incident data is received');
this.loading = true;
this.receivedIncident = data.result[0];
})
}
I am getting errors: Cannot find the name 'desc_ci'??
Any ideas?
"desc_ci.serial_number" : "value". Your code also needs to reference it correctly which you can do using a property indexer{{receivedIncident['desc_ci.serial_number']}}