Search code examples
angularjsangular-filters

Angular filter dependency with angular.module


I've used this example in my project. (It's the groupBy: 'team' clause that I'm trying to make it work)

The dependency in question is angular-filter

http://jsbin.com/weyov/45/edit?html,js,output

The difference in my code from the linked example is that I'm bootstrapping angular module so I'm getting injector errors. (I've tried to use ng-filter)

var app = angular.module("announcements", ["ng-filter"]);
app.controller("Controller", function($scope, $http) {

});

angular.bootstrap(document.getElementById("announcements"), ["announcements"]);

I believe I've to pass something in the angular.module but not sure what value. Please advise.

Angular Error Page


Solution

  • The module you linked to here angular-filter has a module named angular.filter, not ng-filter like you have in your post. The following should get rid of your injector errors

    var app = angular.module("announcements", ["angular.filter"]);  //changed from ng-filter
    app.controller("Controller", function($scope, $http) {
    
    });
    
    angular.bootstrap(document.getElementById("announcements"), ["announcements"]);