angularjs – 为什么我在JSFiddle中得不到错误模块?

前端之家收集整理的这篇文章主要介绍了angularjs – 为什么我在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.

知道为什么我上面会出现错误吗?

解决方法

您的代码没有问题,因为您要添加外部脚本,只需更改即可

Javascript设置 – >加载类型 – >换行< Head>

enter image description here

猜你在找的Angularjs相关文章