【问题标题】:Error: [$injector:modulerr] Failed to instantiate module dx due to:Error: [$compile:baddir] Directive name 'DOMComponent' is invalid错误:[$injector:modulerr] 无法实例化模块 dx,原因是:错误:[$compile:baddir] 指令名称“DOMComponent”无效
【发布时间】:2018-07-01 20:47:11
【问题描述】:

我在运行应用程序时收到此错误。 角度:1.6.8 jQuery:2.2.4 鲍尔:1.8.2

屏幕是空白的。

未捕获的错误:[$injector:modulerr] 无法实例化模块 ftfwebApp 由于:错误:[$injector:modulerr] 无法实例化 模块 dx 由于:错误:[$compile:baddir] 指令名称 “DOMComponent”无效。第一个字符必须是小写 信件 http://errors.angularjs.org/1.4.3/$compile/baddir?p0=DOMComponent 在http://localhost:8080/bower_components/angular/angular.js:68:12 在 assertValidDirectiveName (http://localhost:8080/bower_components/angular/angular.js:6905:13) 在 $CompileProvider.registerDirective [作为指令] (http://localhost:8080/bower_components/angular/angular.js:6932:7) 在 runInvokeQueue (http://localhost:8080/bower_components/angular/angular.js:4356:35) 在http://localhost:8080/bower_components/angular/angular.js:4364:11 在 forEach (http://localhost:8080/bower_components/angular/angular.js:336:20) 在加载模块

【问题讨论】:

  • 展示你的模块

标签: javascript angularjs


【解决方案1】:

更改指令名称

DOMComponent to dom-component

您应该在 html 中使用破折号分隔的名称,并在指令中使用 camelCase 作为对应名称。

【讨论】:

    猜你喜欢
    • 2023-03-27
    • 1970-01-01
    • 2016-05-23
    • 1970-01-01
    • 2022-08-22
    • 2015-01-02
    • 2018-04-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多