我有此错误,如果您可以帮助我,我不知道该如何解决。
<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 "do what I mean"/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] 删除。
我来说两句