0
我希望我的页面依赖于从Observable发出的模型对象。如果对象是一个名单,我会使用如何在模板中设置上下文变量
<div ngFor="let currentListItem of myObservable | async" >
然而,ngFor
是不适用的,因为我没有的型号列表,但只有一个。有什么样
这将让我像这样访问
<div ngContext="let currentItem of myObservable |async" >
<label>{{currentItem.name}}
</div>
...什么问题?什么是'ngContext'? – developer033
ngContext是我正在查找的属性示例。基本上,东西会暴露div内的一个变量 –
看看它是你在找什么:'
{{currentItem.name}}