Angularjs 错误:[$injector:modulerr]未能实例化模块应用程序
我有这个错误,我不知道如何解决它们,如果你能帮助我的话 我的网页html如下Angularjs 错误:[$injector:modulerr]未能实例化模块应用程序,angularjs,codemirror,Angularjs,Codemirror,我有这个错误,我不知道如何解决它们,如果你能帮助我的话 我的网页html如下 <html ng-app="app"> ... <div ng-controller="codeCtrl"> <textarea ui-codemirror ng-model="code">{{ code }}</textarea> </div> 您的页面上似乎没有包含依赖项[ui],并且没有实例化该依赖项, 此外,当您想要编写控制器
<html ng-app="app">
...
<div ng-controller="codeCtrl">
<textarea ui-codemirror ng-model="code">{{ code }}</textarea>
</div>
您的页面上似乎没有包含依赖项
[ui]
,并且没有实例化该依赖项,
此外,当您想要编写控制器时,您需要这样编写:
function codeCtrl($scope) {
$scope.code= '<html style="color: green"> <head> <title>HTML Example/title> /head> body> The indentation tries to be <em>somewhat "do what I mean"/em>... but might not match your style. </body> </html>';
};
myApp.controller('codeCtrl',codeCtrl);
函数codeCtrl($scope){
$scope.code='HTML示例/title>/head>body>缩进尝试“照我的意思做”//em>…但可能与您的样式不匹配';
};
myApp.controller('codeTRL',codeTRL);
我没有在html页面中包含js脚本,
我建议使用['ui.codemirr'],而不是['ui']
感谢您的回答什么是
[ui]
模块?您确定它可用吗?另外,您是否将这些模块包括在index.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
function codeCtrl($scope) {
$scope.code= '<html style="color: green"> <head> <title>HTML Example/title> /head> body> The indentation tries to be <em>somewhat "do what I mean"/em>... but might not match your style. </body> </html>';
};
myApp.controller('codeCtrl',codeCtrl);