S
S
Stepan2015-02-09 16:54:17
JavaScript
Stepan, 2015-02-09 16:54:17

How to change the template depending on which element the directive hangs on?

There is a directive and several elements on which it hangs. Depending on which element is clicked, one or another template is drawn. Each of the elements has its own parameters by which you can identify what you clicked on. But the link does not want to render to any and does not give errors

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DigitalSmile, 2015-02-09
@xoma2

By the time the link is processed, the template should already be ready (it already has controller and element objects). Therefore, it will not work to dynamically substitute the template in the link, only in compile or templateUrl ( https://github.com/angular/angular.js/issues/1039 ).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question