我想實現一個自定義過濾器。我得到了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會在這裏提供你快速的回答。 –