A
A
Alexander Zemlyanoy2016-03-25 08:45:54
JavaScript
Alexander Zemlyanoy, 2016-03-25 08:45:54

How to make a dynamic template directive?

Hello. I'm new to Angular.js and just getting started with it. Now I can’t figure out how to write a directive so that its template is updated after changing the variable, for example in this case.
codepen.io/Galamoon/pen/oxwvEZ
I tried many options,

but either the skis don't go or I'm a fool
In general, I hope for your help.
Thanks in advance to all those who care.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-03-25
@Galamoon

I'm new to Angular.js and just getting started with it.

If you need to replace the contents of the block, then it is better to do it in general through transclude. And if it's just what would work:
instead of $attrs, use scope
scope: {
        content: '@uiTooltip'  
    },

ps better take the finished implementation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question