S
S
Sserge2014-05-30 19:22:17
Angular
Sserge, 2014-05-30 19:22:17

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

2 answer(s)
M
maxaon, 2014-05-30
@maxaon

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.

D
DizzyJager, 2014-05-30
@DizzyJager

https://docs.angularjs.org/api/ng/directive/ngSwitch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question