I have the following error for dependency injection in my controller:
Error: [$ injector: unpr] Unknown provider: $ routeProviderProvider
I have the following error for dependency injection in my controller:
Error: [$ injector: unpr] Unknown provider: $ routeProviderProvider
A provider
is only available in the configuration cycle:
var module = angular.module('MainModule', ['ui.filters', 'ngRoute']);
module.config(function($routeProvider) { // Ciclo de configuração
$routeProvider.when("/", {
templateUrl : "consult.htm"
});
});
To use during the run cycle, use the service directly:
//Utilize $route, não $routeProvider
module.controller('MainCtrl', function($scope, $route) {
$scope.route = $route;
});