Monday, December 10, 2018

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

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...