如何在ngContainer中使用变量

时间:2019-03-25 09:07:13

标签: angular

 <ng-container "let test= someList[1]"></ng-container>

我想在ng-container中使用变量

但是该代码无法正常工作。怎么做对了?

1 个答案:

答案 0 :(得分:0)

尝试

<ng-container "let test = someList[1]">
  {{test.name}} //if someList[1] is an object 
  {{test}} //if someList[1] is something like [1,2,3....]
</ng-container>
相关问题