当我遇到问题时,我正在尝试编写一个简单的Angular应用程序。我完全简单和简短的样板代码在Codepen中完全运行,但它无法在JSFiddle中运行。我在下面创建的代码段工作正常,但我无法弄清楚为什么它在JSFiddle中不起作用。谁能指出问题是什么?
Codepen链接: http://codepen.io/chalarangelo/pen/YWdvBV
JSFiddle链接: https://jsfiddle.net/chalarangelo/1d12hm5f/1/
代码段:
var app = angular.module('myApp', []);
app.controller('myController', [
'$scope',
function($scope) {
$scope.demoText = 'AngularJS: This is some demo text!';
}
]);

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
<div ng-app="myApp">
<div ng-controller="myController">
<p>
{{ demoText }}
</p>
</div>
</div>
&#13;