我宣布这个模块:
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.
知道为什么我上面会出现错误吗?