M
M
Maxim2015-04-24 21:09:41
JavaScript
Maxim, 2015-04-24 21:09:41

How to set global check for show/hide in angular?

The application only needs to display an element on one page in a particular controller. How can this be done globally?
It only comes to mind to reset the parameter at which the element is displayed.
Tell me, is there a better option?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kano, 2015-04-25
Antonikhin @STJ

Get a global property in $rootScope, bind the ng-show directive to this property, subscribe to ngRoute events as described here stackoverflow.com/questions/14765719/how-to-watch-...
Well, change your global property depending on the value way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question