Unknown Provider: ifFilterProvider <- ifFilter at the angle

Asked

Viewed 58 times

1

I have next in my app.js

(function(){    
  'use strict';    
  angular
 .module('app', ['ngResource','ngRoute'])
 .config(function ($routeProvider) {
    $routeProvider
        .otherwise({
            redirectTo: '/'
        });
 })
 .controller('AppCtrl', ["$scope", "$rootScope", "$location", "$timeout",
    function($scope, $rootScope, $location, $timeout) {
    }]);    
}());

My html:

<html lang="pt-br">

    <head>
    </head>

    <body ng-app="app" ng-controller="AppCtrl">
    </body>

</html>

But when I start the application the following message appears :

Error: [$injector:unpr] Unknown provider: ifFilterProvider <- ifFilter

Has anyone experienced similar problem?

1 answer

1

According to the documentation, you should inject $routeProvider this way:

.config(['$routeProvider', function ($routeProvider) {
  $routeProvider
       .otherwise({
          redirectTo: '/'
   });
}])

In this link you can follow step by step how to do: https://docs.angularjs.org/tutorial/step_07

I hope I’ve helped

  • Thank you very much Marco Antônio!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.