AngularJS 1.x custom filter can't be injected, unknown provider

前端 未结 4 2100
温柔的废话
温柔的废话 2021-02-20 03:15

I\'m trying to create a custom filter, but when I try to inject it into my controller, I get an \'Unknown provider\' error. I have checked and double checked all the references,

4条回答
  •  抹茶落季
    2021-02-20 04:09

    you didn't mention if it's in production or on a local server, but just in case you are minifying your files, try this:

    angular.module('equiclass.controllers')
      .controller('CourseCtrl', ['$scope', 'testFilter', function ($scope, testFilter) {
    
      }]);
    

提交回复
热议问题