Hello,
I'm pulling in a record from the database and trying to display the record
without running it through *ngFor as its only returned one record.
I *confirmed* the data is returned using {{userDetails | json}}.
I can display the array via *ngFor but its just a record so there's no need
to loop through the record using *ngfor.
I tried {{userDetails.firstname}}, {{userDetails[0].firstname}}, and
{{userDetails?.firstname}} nothing seems to be working.
*what am i missing?*
The funny thing is that the component script and the service script are
basically a copy/past from one of my working script so im lost as to what
is this I'm missing.
any help you can provide would be greatly appreciated.
*error message: *
EXCEPTION: Uncaught (in promise): Error: Error in ../app/userporting/user-
details.component.html:6:53 caused by: Cannot read property 'firstname' of
undefined
Error: Error in ../app/userporting/user-details.component.html:6:53 caused
by: Cannot read property 'firstname' of undefined
*record returnd in this format:*
[ { "firstname": "Mike", "lastname": "smith", "age": "29-Mar-78" } ]
*Component*
userDetails : any;
this.getInfService.getUserMethod(this.userID)
.subscribe(data => this.userDetails = data);
service
return this._http.post(this.usrQueryURL, getUserInfo, options )
.map((res: Response) => res.json())
.catch(error => <any>error);
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.