我想实现一个自定义过滤器。我得到了angularjs的依赖错误。请帮我解决这个问题。无法理解angulajs依赖性错误
下面是我的代码...
angular.module('Test', [])
.controller('TestController', ['$scope', function ($scope) {
$scope.myDate = 1456106575956;
}])
.filter('utcToDate', function(pUTCString) {
return function(pUTCString) {
return new Date(pUTCString);
}
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<body ng-app="Test" ng-controller="TestController">
{{myDate | utcToDate:myDate }}
</body>
添加你所得到的错误。 Plunker会在这里提供你快速的回答。 –