我宣布这个模块:为什么我在JSFiddle中找不到错误模块?
angular.module('dashboard', [])
.controller('dashboardController', ['$scope',
function ($scope) {
$scope.data = "555";
}]);
这里是视图:
<div ng-app="dashboard" data-role="page" id="layersProperty" data-add-back-btn="true" >
<div ng-controller="dashboardController">
{{data}}
</div>
</div>
这里是FIDDLE。
在控制台中我得到这个错误:
Error: [$injector:nomod] Module 'dashboard' 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://jsbin.com/qekezayipa/edit?html,js,output – Shyju
确实很奇怪。您完全相同的代码,从相同的位置加载angular.js,在plnkr正常工作:http://plnkr.co/edit/NHqBPkItZiNsqhJ8beG7?p=preview –
在的jsfiddle,改变的JavaScript的负载类型是'不包 - 在
'或者'不循环 - 在'而不是onLoad'的'。这是一个JSFiddle的事情,以及它如何与Angular协同工作。 – Lex