Sunday 26 March 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

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...