刚学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>
以下是浏览器运行结果,报错是类型错误?
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)
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。