Thursday, 21 September 2017

javascript - DOM manipulation in Angular directive after sub view rendering

I need a directive that will truncate long text in element and show a popover with full text in case truncation take place.



See http://plnkr.co/edit/90WP5ISQHG7FXRpetucm?p=preview


For text truncation I've used CSS and it works well.
But when I'm trying to access element content I see {{str.data}} rather then exact text from the data.



I guess that I need even't that is fired after rendering, but I can't fing any suitable.




So my question how can I run my DOM manipulation after sub view get rendered?



The only solution I've found so far is using timeout, but I think that there is better solution for it.

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...