加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

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

发布时间:2020-12-17 17:28:49 所属栏目:安全 来源:网络整理
导读:我宣布这个模块: 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
我宣布这个模块:

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读