Answer the question
In order to leave comments, you need to log in
How to use the AngularJS Cookie module outside of controllers?
Hello, I started to learn AngularJS and ran into the problem of using the cookie module ( ngCookies ) outside of controllers, namely in the HTML attribute ng-show="$cookies.get('token') != null" , to show the block only if the cookie exists token
How to fix this? Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Put the token in $rootScope and just use ng-show="token != null"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question