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

I want use variable in ng-container

But that code is not working. How to make it right?

qweqwe
  • 141
  • 1
  • 1
  • 7
  • You can check the answer right here : https://stackoverflow.com/questions/38582293/how-to-declare-a-variable-in-a-template-in-angular – Martin Paucot Mar 25 '19 at 09:11

1 Answers1

-1

Try this

<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>
Seba Cherian
  • 1,755
  • 6
  • 18