错误:[$ injector:modulerr]无法实例化模块应用程序

暗人

我有此错误,如果您可以帮助我,我不知道该如何解决。

<html ng-app="app">
...    
<div ng-controller="codeCtrl">
        <textarea ui-codemirror ng-model="code">{{ code }}</textarea>
</div>

和我的代码js如下:

        var myApp  = angular.module('app', ['ui']);

        myApp.value('ui.config', {
            codemirror: {
                lineNumbers: true,
                htmlMode: true,
                mode: "text/html",
                theme: "ambiance",
                indentWithTabs: false,
                readOnly: true,
                matchBrackets: true
            };                  
        });

        function codeCtrl($scope) {
            $scope.code= '<html style="color: green"> <head>    <title>HTML Example/title>  /head>    body> The indentation tries to be <em>somewhat &quot;do what  I mean&quot;/em>... but might not match your style.  </body> </html>';
        };

我把这个错误

 Error: [$injector:modulerr] Failed to instantiate module app due to:
 [$injector:nomod] Module 'app' is not available! You either misspelled the module name    or forgot to load it. If registering a module ensure that you specify the dependencies as   the second argument.
  http://errors.angularjs.org/1.2.10/$injector/nomod?p0=app
暗人

我错过了在HTML页面中包含js脚本的功能,建议使用['ui.codemirror']代替['ui']

谢谢您的回答

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

未捕获的错误:[$ injector:modulerr]无法在Apache上的Angular.js应用程序上实例化模块错误

错误:$injector:modulerr 模块错误。应用程序无法路由到不同的页面

未捕获的错误:[$ injector:modulerr]无法实例化模块

角度指令测试-错误:[$ injector:modulerr]无法实例化模块?

AngularJS:未捕获的错误:[$ injector:modulerr]无法实例化模块?

未捕获的错误:[$ injector:modulerr]无法实例化模块myModule

角度错误[$ injector:modulerr]无法实例化模块myApp

未捕获的错误:[$ injector:modulerr]由于以下原因而无法实例化模块:错误:[$ injector:nomod]模块

未捕获的错误:[$ injector:modulerr]无法使用LABJS实例化模块

错误:[$ injector:modulerr]由于(Angularjs)无法实例化模块ui.grid

AngulaJs + TypeScript:未捕获的错误:[$ injector:modulerr]无法实例化模块

Karma 错误:[$injector:modulerr] 由于以下原因无法实例化模块:(Index.html 工作正常)

未捕获的错误:[$ injector:modulerr]由于以下原因而无法实例化模块polmgr:

未捕获的错误:[$ injector:modulerr]由于以下原因,无法实例化模块匹配点:

Angular JS:未捕获的错误:[$injector:modulerr] 无法实例化模块

错误:[$injector:modulerr] 无法实例化模块 customerApp 由于:错误:[$injector:unpr] 未知提供者:$routeProvider

由于以下原因无法实例化模块应用程序:错误:模块“应用程序”不可用

$我的角度应用程序的$ injector:modulerr错误

在将模块添加到Angular应用程序时遇到错误:未捕获的错误:[$ injector:modulerr]

我的自定义提供程序出现错误“由于未知的提供程序而无法实例化模块应用程序”

如何捕获“无法实例化应用程序”错误?

Android:无法实例化应用程序错误

错误:$ injector:modulerr模块错误

无法实例化模块启动,原因是:错误:[$ injector:nomod]

无法实例化扩展应用程序类的应用程序错误

Express.js应用程序尝试使用角度:未捕获错误:[$ injector:nomod]和未捕获错误:[$ injector:modulerr]

未捕获错误:[$ injector:modulerr]和未捕获ReferenceError:应用程序未定义

角路由错误:$ injector:modulerr模块错误

角度错误:$ injector:modulerr模块错误