0

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.

0

2 Answers 2

0

Do you mean just a simple rollover to show the remainder text? That's simple CSS.

.truncate-overflow:hover{ width:auto; overflow:visible; }

If not that, I would suggest storing the data into two separate pieces of data by limiting the string length. See how to do that: https://stackoverflow.com/a/7463674/1327678

Sign up to request clarification or add additional context in comments.

1 Comment

Not exactly, I need to show bootstrap help-tooltip that will contain the full string, only if overflow take place.
0

I worked around this issue by performing my DOM manipulation inside mouseover instead of link method.

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

PS. Popover position is incorrect because plnkr overrides css manipulation and do not set top and left.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.