Hi Dawg,
Yes, this can by much simpler when you use the async pipe in your template.
Controller:
this.projectListFromD = this._getPopulateDropDownList.getProjectListMethod()
this.projectTaskFromDB = this._getPopulateDropDownList.getProjectTaskMethod
()
in your template, something like:
<ul>
<li ngFor="let item of projectListFromDB |async">{{item.name}}</li>
<ul>
error display: (this is syntax from the NEXT angular version that gets
rolled out! Does not work in current versions!)
<div *ngIf="projectListFromDB | async; else loading; let list">
<span ngIf="list.length === 0">Sorry, we failed stage 1</span>
</div>
<template #loading>Loading data from DB...</template>
Hope this helps you a bit.
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"Angular" 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.