Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select New DOM elements created by Angularjs ng-repeat

Tags:

angularjs

I am using Angularjs for a web application. I have tried searching to find a solution to my problem, and it seems that Angularjs do not facilitate an easy way to access newly created DOM elements within ng-Repeat.

I have prepared a jsfiddle to show the actual problem. here is the link: http://jsfiddle.net/ADukg/956/

Please let me know how to select the new DOM element within ng-repeat.

like image 897
Raftalks Avatar asked Oct 23 '22 07:10

Raftalks


1 Answers

To expand on my comment, I have updated your fiddle to show a simple implentation of a directive that alerts the class of the element.

http://jsfiddle.net/ADukg/994/

Original comment:

Regarding dom manipulation in the controller, it says here that you should not do it at all. It should go in a directive. The controller should only contain business logic.

Why it doesn't work, I don't know, but it's probably because angular is still running its own stuff at this point in time.

like image 136
Narretz Avatar answered Nov 03 '22 20:11

Narretz