In Angular, we can inject $routeProvider
to the config
function
module.config(function ($routeProvider) {
});
I want to inject my service into it like
module.config(function ($routeProvider, myService) {
});
I am sure the service is defined properly, but it throws an exception saying that unknown myService
, event when I inject like
module.config(function ($routeProvider, $http) {
});
it still says unknown $http
.
Do you know why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…