Answer the question
In order to leave comments, you need to log in
How to implement complex output in angularjs?
Hello, I'm starting to learn AngularJs.
In my application, depending on the state, either a button or a div with text or a link should be displayed.
I can’t figure out how best to do it, through the filter - somehow, in my opinion, there is too much functionality for the filter?
Create a new directive - but I didn't understand if it's possible to use multiple templates.
Where to look in such a task?
Thank you!
Answer the question
In order to leave comments, you need to log in
You can use ngSwitch , you can use ngIf .
If you need to do it without watchers and the type will not change, you can edit the template during the compilation stage of the directive.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question