|Accessing services in the view||Adam Wynne||4/9/12 4:08 AM|
I'd like to be able to access my services in the view (so if I've written a service called 'auth', I could use something like ng-show="auth.loggedIn"
this (broken) fiddle demonstrates what I'd like to do:
Any help appreciated
|Re: [angular.js] Accessing services in the view||Pete Bacon Darwin||4/9/12 7:57 AM|
In this fiddle the $location service is passed straight through to the scope. Personally, I would use the controller to give a layer of abstraction between the view and the service by creating a method like your url() method.
|Re: [angular.js] Accessing services in the view||Adam Wynne||4/9/12 12:57 PM|
brilliant - thanks :)