dom - How to access svg element with dynamic id in link function of AngularJS template directive? -


I am trying to reuse template instructions in the ng-repeat loop. I am passing the instructions to an ID which uses the following in the following template:

  & lt; G id = "scaling {{id}}" & gt; \ ... and lieutenant; / G & gt;  

It works perfectly, it is sung properly in the final HTML page. Now this is the thing that I am trying to set some style attributes to choose the above element with the dynamic id set dynamically in the link function of the directive as the following:

  d3.select ('#scaling' + scope.id}.  

However, it always gives empty space. That is what I have understood from searching around me. Because the element is not yet in the DOM How do I create this question? How do I work in this? Thank you very much!

So I found myself a solution. The DOM selection query can be added to the function, which will only be called after the DOM.


Comments