我该如何解决这个错误:[$喷油器:unpr]未知提供商 [英] How do I resolve this: Error [$injector:unpr] Unknown provider

查看:290
本文介绍了我该如何解决这个错误:[$喷油器:unpr]未知提供商的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个新手平均栈是如何在我的AngularJS code解析错误不清楚。这就是我不断收到错误:

I'm a newbie to the MEAN stack and am unclear on how to resolve an error in my AngularJS code. This is the error I keep getting:

Error: [$injector:unpr] Unknown provider: dataFilterProvider <- dataFilter

我不太知道从哪里来尝试解决该错误。也许我的控制器文件:

I'm not quite sure where to try to resolve the error. Perhaps my controller file:

angular.module('articles').controller('ArticlesController', ['$scope', '$routeParams', '$location', 'Authentication', 'Articles',
    function($scope, $routeParams, $location, Authentication, Articles) {

         // various $scope methods

    }
]);

任何人有事情要考虑,以解决此错误的一些想法?

Anyone have some ideas of things to look into in order to resolve this error?

更新:
我跟踪它到这行我view.html文件之一:

UPDATE: I tracked it down to this line of one of my view.html files:

<em data-ng-bind="article.created | data:'mediumDate'"></em>

也许,我需要去通过我的模型,并确保我有这些值重新psented正确$ P $。

Perhaps I need to go through my model and make sure I have those values represented properly.

推荐答案

原来我在这条线的小错字:

Turns out I had a small typo in this line:

<em data-ng-bind="article.created | data:'mediumDate'"></em>

我需要将其更改为:

I needed to change it to:

<em data-ng-bind="article.created | date:'mediumDate'"></em> // CHANGED 'data' to 'date'

这篇关于我该如何解决这个错误:[$喷油器:unpr]未知提供商的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆