我想将Plnkr 中的这段代码移动到JSBin。它不起作用,并且 DevTools 显示Error: ui-codemirror needs CodeMirror to work... (o rly?)
.
Plnkr 似乎有一些 JSBin 没有的依赖管理。我想知道 Plnkr 在屏幕后面做了什么,并在 JSBin 中运行这段代码,有谁知道如何修改链接和来源以使其工作?
<!DOCTYPE html>
<html ng-app="x">
<head>
<meta charset="utf-8" />
<title>UI.Codemirror : demo </title>
<!-- Le css -->
<link rel="stylesheet" type="text/css" href="http://codemirror.net/lib/codemirror.css"/>
<link rel="stylesheet" type="text/css" href="http://codemirror.net/theme/twilight.css"/>
</head>
<body>
<!-- Le content... -->
<section>
<div ui-codemirror="{
lineNumbers: true,
theme:'twilight',
readOnly: 'nocursor',
lineWrapping : true,
mode: 'xml'
}" ><html style="color: green">
<!-- this is a comment -->
<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></div>
</section>
<!-- Le vendor... -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js"></script>
<script src="http://codemirror.net/lib/codemirror.js"></script>
<script src="http://codemirror.net/mode/xml/xml.js"></script>
<script src="https://rawgithub.com/angular-ui/ui-codemirror/bower/ui-codemirror.min.js"></script>
<script src="app.js"></script>
</body>
</html>
JavaScript:
var app = angular.module('x', ['ui.codemirror']);