Is there a trick to select multiple tag within same level with same tag?
<div #el></div>
<div #el></div>
<div #el></div>
It's always given "Reference "#el" is defined several times" error message.
Thanks in advance
Is there a trick to select multiple tag within same level with same tag?
<div #el></div>
<div #el></div>
<div #el></div>
It's always given "Reference "#el" is defined several times" error message.
Thanks in advance
Below approach is working fine for me for multiple elements with appropriate selector.
I have an requirement to load the popup modal dynamically from code base and also perform some actions like Minimize, Maximize, Close and Resize. At that time I have to pick the any one opened modal to perform some operation and I came up with this solution.
Below is my HTML, In which I used #dynamicPopupContentPlaceHolder as selector for div tag.
Firstly, Need to add the QueryList in component from angular/core library as shown below.
Finally, In the component file I used the QueryList (Contains the array of children) to get all the children using below way.
At end I used the widgetSelector variable to get the last child from array using below way.
let _targetSelector = this.widgetTargets.last;
Include ViewChildren.
Now you can use the following code.