当我尝试使用角度滤镜时,我遇到了一些问题:
我已在HTML文件中导入了这些链接:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-filter/0.5.11/angular-filter.min.js"></script>
我在js文件中添加了模块:
var app = angular.module('angularPrueba',[angular.filter]);
我有这些错误:
https://docs.angularjs.org/error/ $注射器/ modulerr P0 = angularPrueba&安培; P1 =错误:%20%$ 5B注射器:modulerr%5D%20http:%2F%2Ferrors.angularjs.org%2F1.2.22%2F $注射器%2Fmodulerr%3Fp0%3Dundefined%26P1%3DError%253A%2520%255Bng%253Aareq%255D%2520http%253A%252F%252Ferrors.angularjs.org%252F1.2.22%252Fng%252Fareq%253Fp0%253Dmodule%2526p1%253Dnot%252520a %252520function%25252C%252520got%252520undefined%250A%2520%2520%2520%2520at%2520https%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.2.22%252Fangular.min.js%253A6%253A450 %250A%2520%2520%2520%2520at%2520Db%2520(HTTPS%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.2.22%252Fangular.min.js%253A18%253A497)%250A% 2520%2520%2520%2520at%2520Va%2520(HTTPS%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.2.22%252Fangular.min.js%253A19%253A78)%250A%2520%2520 %2520%2520at%2520https%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.2.22%252Fangular.min.js%253A33%253A404%250A%2520%2520%2520% 2520at%2520r%2520(HTTPS%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.2.22%252Fangular.min.js%253A7%253A290)%250A%2520%2520%2520%2520at%2520e %2520(HTTPS%253A%252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.2.22%252Fangular.min.js%253A33%253A148)%250A%2520%2520%2520%2520at%2520https%253A% 252F%252Fajax.googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.2.22%252Fangular.min.js%253A33%253A225%250A%2520%2520%2520%2520at%2520r%2520(HTTPS%253A%252F%252Fajax。 googleapis.com%252Fajax%252Flibs%252Fangularjs%252F1.2.22%252Fangular.min.js%253A7%253A290)%250A%2520%2520%2520%2520at%2520e%2520(HTTPS%253A%252F%252Fajax.googleapis.com %252Fajax%252Flibs%252Fangularjs%252F1.2.22%252Fangular.min.js%253A33%253A148)%250A%2520%2520%2520%2520at%2520gc%2520(HTTPS%253A%252F%252Fajax.googleapis.com%252Fajax% 252Flibs%252Fangularjs%252F1.2.22%252Fangular.min.js%253A36%253A252)%0A%20%20%20%20个原子%20https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.22% 2Fangul ar.min.js:6:450%0A%20%20%20%20个原子%20https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.22%2Fangular.min.js:34:28 %0A%20%20%20%20原子%20R%20(HTTPS:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.22%2Fangular.min.js:7:290)%0A%20 %20%20%20原子%20E%20(HTTPS:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.22%2Fangular.min.js:33:148)%0A%20%20%20 %20AT%20https:%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.22%2Fangular.min.js:33:225%0A%20%20%20%20原子%20R%20(HTTPS: %2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.22%2Fangular.min.js:7:290)%0A%20%20%20%20原子%20E%20(HTTPS:%2F%2Fajax .googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.22%2Fangular.min.js:33:148)%0A%20%20%20%20原子%20gc%20(HTTPS:%2F%2Fajax.googleapis.com %2Fajax%2Flibs%2Fangularjs%2F1.2.22%2Fangular.min.js:36:252)%0A%20%20%20%20原子%20c的20%(HTTPS:%2F%2Fajax.googleapis.com%2Fajax%2Flibs %2Fangularjs%2F1.2.22%2Fangular.min.js:18:60)%0A%20%20%20%20原子%20fc%20(HTTPS:%2F%2Fajax.googleapis.com%2Fajax%2Flibs% 2Fangularjs%2F1.2.22%2Fangular.min.js:18:277
答案 0 :(得分:0)
不确定您正在使用哪个'angular-filter'库,但您必须添加模块依赖项作为您要添加为依赖项的模块的字符串名称。
因此,如果'angular-filter'库的主模块名称为var app = angular.module('angularPrueba',['angular.filter']);
,则应将其添加为字符串:
[2016-11-18 09:17:53] request.INFO: Matched route "{route}". {"route":"homepage","route_parameters":{"_controller":"AppBundle\\Controller\\DefaultController::indexAction","_route":"homepage"},"request_uri":"http://localhost:8080/","method":"GET"} []
[2016-11-18 09:17:53] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
[2016-11-18 09:17:53] request.CRITICAL: Uncaught PHP Exception LogicException: "The controller must return a response (Object(FOS\RestBundle\View\View) given)." at /vagrant/taskiyaki/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 171 {"exception":"[object] (LogicException(code: 0): The controller must return a response (Object(FOS\\RestBundle\\View\\View) given). at /vagrant/taskiyaki/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:171)"} []
如果您不知道模块的名称,请查看图书馆的网站或查看其源代码。