<form *ngIf="filters">
<ng-container *ngTemplateOutlet="filterTemplate; context: {$implicit: filters}"></ng-container>
</form>
<ng-template #filterTemplate let-filters>
<ng-container *ngFor="let field of filters">
{field.something}
</ng-container>
<ng-template>
ng-container中的 filters
为空,有人可以告诉我我在哪里/哪里做错了吗?
答案 0 :(得分:1)
如果您正确设置了>>> import numpy as np
>>> arr = np.random.rand(3,3) + 1j*np.random.rand(3,3)
... print(arr)
[[0.44078748+0.29907718j 0.79358223+0.02234568j 0.20919567+0.34527526j]
[0.05402969+0.24115898j 0.20941358+0.55299497j 0.29743888+0.32179154j]
[0.60174937+0.9542182j 0.47197093+0.9202769j 0.41205623+0.27288905j]]
>>> np.set_printoptions(formatter={'complex_kind': '{:.2f}'.format})
>>> print(arr)
[[0.44+0.30j 0.79+0.02j 0.21+0.35j]
[0.05+0.24j 0.21+0.55j 0.30+0.32j]
[0.60+0.95j 0.47+0.92j 0.41+0.27j]]
数据,则代码中没有没有问题:
filters
WORKING DEMO (使用ngIf /并使用setTimeout进行模拟数据延迟)