我是
angularjs和ng-grid的新手……我目前正在通过一个简单的ng-grid示例,但我似乎无法让它工作.
这是我的HTML:
<!DOCTYPE html> <html ng-app="myApp"> <head lang="en"> <Meta charset="utf-8"> <title>Getting Started With ngGrid Example</title> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.css" data-semver="2.0.11" data-require="ng-grid@*" /> <link rel="stylesheet" type="text/css" href="css/style.css" /> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js" data-semver="2.1.1" data-require="jquery@*"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.7/angular.js" data-semver="1.3.7" data-require="angular.js@*"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.min.js" data-semver="2.0.11" data-require="ng-grid@*"></script> <script src="js/controllers.js"></script> </head> <body ng-controller="MyCtrl"> <h1>{{title}}</h1> <div class="gridStyle" ng-grid="gridOptions"> </div> </body> </html>
这是我的js:
'use strict'; var app = angular.module('myApp',['ui.grid']); app.controller('MyCtrl',function($scope) { $scope.myData = [{name: "Moroni",age: 50},{name: "Tiancum",age: 43},{name: "Jacob",age: 27},{name: "Nephi",age: 29},{name: "Enos",age: 34}]; $scope.gridOptions = { data: 'myData' }; $scope.title = "ng-grid example"; });
我还在Plunker中创建了一个我的问题示例:http://plnkr.co/edit/9fEF8sBAMhaMxWimLfTn?p=preview
谢谢!
莎娜
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。