Hi Tolga,
>
> displayContactFullName(contactId: string) {
> if (contactId) {
> return this.contactService.getContact(contactId).subscribe(rawContact => {
> this.contact = new Contact(rawContact);
> let returnValue = this.contact.detail.fullName;
> console.log(returnValue);
> return returnValue;
> });
> }
> else {
> return of(contactId);
> }
> }
>
Make sure you always return an observable, (the change I did above) and
then use the async pipe in your template.
Be aware that this might lead to a huge number of small requests. Perhaps
it's better to load the entire file at once?
Regards
Sander
--
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.