开发者社区> 问答> 正文

angularjs ng-grid报错,怎么解决? 400 请求报错

刚学angularJS ,虽然取得到数据,但控制台报错了,请问出错在哪里?

<!DOCTYPE html>
<html ng-app="indexApp">
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
<script src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js"></script>
    <script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
    <link rel="stylesheet" href="http://cdn.bootcss.com/ng-grid/2.0.11/ng-grid.min.css"/>
    <script src="http://cdn.bootcss.com/ng-grid/2.0.11/ng-grid.min.js"></script>
    <style>
        .gridStyle{height: 300px;}
    </style>
</head>
<body>
<div ng-controller="gridCtrl">
    <div class="gridStyle" ng-grid="gridOptions"></div>
</div>
<script>
    var indexApp = angular.module('indexApp', ['ngGrid']);
    indexApp.controller('gridCtrl', function($scope) {
        $scope.members = [{name: "Moroni", age: 50},
            {name: "Tiancum", age: 43},
            {name: "Jacob", age: 27},
            {name: "Nephi", age: 29},
            {name: "Enos", age: 34}];
        $scope.gridOptions = { data: 'members' };
    });
</script>
</body>
</html>

以下是浏览器运行结果,报错是类型错误?

展开
收起
kun坤 2020-05-29 17:30:18 687 0
1 条回答
写回答
取消 提交回答
  • TypeError: undefined is not a function
        at l.assignGridEventHandlers (http://localhost:63342/test20160711/ng-grid.min.js:1:20559)
        at new x (http://localhost:63342/test20160711/ng-grid.min.js:1:20769)
        at http://localhost:63342/test20160711/ng-grid.min.js:2:20918
        at http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js:118:334
        at n.$eval (http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js:132:452)
        at n.$digest (http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js:129:463)
        at n.$apply (http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js:133:236)
        at http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js:20:59
        at Object.e [as invoke] (http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js:39:193)
        at d (http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js:19:482)
    2020-05-29 17:30:25
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
探究 Node.js 的服务端之路 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载