This is the first time I've tried using Angular with Wordpress. I want to inject $location
into the config
module so I can use it like this:
app = angular.module 'app', [ 'ngResource', 'ngRoute' ]
app.config [ '$routeProvider', '$location', ( $routeProvider, $location )->
$location.hasPrefix '!'
$location.html5Mode true
]
Unfortunately, using $location
or $locationProvider
with config
is causing an Unknown Provider error. I've included all necessary dependencies ie. angular-route.min.js
, however, it's still not resolving properly.
If I remove $location
it works.
app = angular.module 'app', [ 'ngResource', 'ngRoute' ]
app.config [ '$routeProvider', ( $routeProvider )->
# ROUTES
]
EDIT
If I replace $location
with $locationProvider
I get Failed to instantiate module app due to: TypeError: Object # has no method 'hasPrefix'