AngularJS给出了一个错误(ngRoute,DevExtreme,TypeScript)
AngularJS gives an error (ngRoute, DevExtreme, TypeScript)
我试图让AngularJS使用DevExtreme。我正在使用打字稿。现在有一个小问题,在我的应用程序中不使用DX模块,一切都可以正常工作。但是在尝试使用DX时,我收到此错误:
角度.js:4087未捕获错误: [$injector:模块rr] http://errors.angularjs.org/1.3.0/$injector/modulerr?p0=myApp&p1=Error%3A%2...loudflare.com%2Fajax%2Flibs%2Fangular.js%2F1.3.0%2Fangular.min.js%3A18%3A3)
我已经在做一些研究,但我找不到解决这个问题的任何方法。
我用于注入模块的代码:
var modules = ['controllers', 'services'];
modules.forEach((module) => angular.module(module, []));
modules.push("ngRoute");
modules.push("dx");
因此,为了清除,它的工作方式是这样的:
var modules = ['controllers', 'services'];
modules.forEach((module) => angular.module(module, []));
modules.push("ngRoute");
提前感谢!
我已经找到了解决问题的方法,在某种程度上AngularJS无法识别dx
。所以我进入错误并搜索和搜索,我发现我必须使用ngSanitze
.所以我只包含了angular-sanitize.js
文件,这解决了我的问题。
我还编辑了我的forEach
循环(在lambda表达式下给出了一些小红线):
var modules = ['controllers', 'services'];
modules.forEach(
(modules) => {
angular.module(modules, []);
});
modules.push("ngRoute");
modules.push("dx");
我希望这也能帮助你们中的一些人。
相关文章:
- Typescript导入导出的类会发出require(..),从而导致浏览器错误
- Typescript编译器错误,Angular 1.5组件应为分号
- Typescript Kendo UI网格列类型错误
- 在新路由器上使用订阅函数时出现Angular 2 typescript错误(rc 1)
- 使用typescript访问导入的服务时发生Angular2错误
- 继承和 TypeScript 错误:X 不是构造函数类型
- TypeScript-错误TS1146:需要声明
- TypeScript错误无法使用'在'操作员搜索'_id'用于typescript和pou
- Angular HTTP GET 与 TypeScript 错误 http.get(..).映射不是 [null] 中的
- typeScript错误'模块、类、接口、枚举、导入或语句'预期
- 忽略Typescript错误”;属性不存在于“”类型的值上;
- 将类放在单独的文件中时发生Typescript错误
- Angular2/TypeScript:错误TS2345:参数类型'String'不能赋值给's
- 如果“需求”没有定义,我该怎么办?编译后的TypeScript错误
- Typescript错误TS2339:属性'webkitURL'在类型'窗口'
- Angular JS&TypeScript-错误:ng:areq错误参数"自变量'XXXXXX
- Typescript错误TS1005:':'预期.使用Object.assign()
- 使用webpack编译时发生TypeScript错误
- TypeScript 错误 TS2082 和 TS2087 将 Away3D 画布分配给变量
- 构建nodeJs时出现Typescript错误