0

<li *ngFor="#item of items" [id]="item.id">some text</li> How to access dynamically created ID in angular in a html div using #

I want to use the ID created in the above code using # dynamically in a div like in the below code. <div #(id created in above code)></div>

Midhul
  • 1
  • 2
  • Does this answer your question? [Dynamic template reference variable inside ngFor (Angular 9)](https://stackoverflow.com/questions/44440879/dynamic-template-reference-variable-inside-ngfor-angular-9) – Tanner Feb 05 '21 at 18:06
  • @Tanner ID doesnt work like in the link you showed. – Midhul Feb 05 '21 at 18:13
  • Is the div where you want to use the dynamic id inside the ngFor? Also why do you have # before #item in the loop? Can you please share a bit more code to represent your goal? – Hugo Noro Feb 05 '21 at 19:46

0 Answers0