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

迟到的企鹅 发布于 2016/07/12 17:01
阅读 209
收藏 0

刚学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>



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

加载中
0
迟到的企鹅
迟到的企鹅
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)



返回顶部
顶部