我无法在我的应用程序中加载ng-grid

时间:2015-04-28 16:31:52

标签: angularjs

在页面

<meta name="viewport" content="width=device-width" />
<title>Welcome to Husys</title>
<link href="~/CSS/layout.css" rel="stylesheet" />
<link href="~/CSS/style.css" rel="stylesheet" />


<script src="~/Scripts/angular.min.js"></script>
<script src="~/Scripts/CustomDirectives/ui-grid.js"></script>
<script src="~/Scripts/appConfig.js"></script>
<script src="~/Scripts/Services/HomeService.js"></script>

在appConfig.JS

var app = angular.module("ApHusys", ['ui.grid']);

    app.run(function ($rootScope){
        $rootScope.MainName = "GlobalName";
    })

无法在我的应用程序中加载网格模块,收到错误模块错误

1 个答案:

答案 0 :(得分:0)

<!DOCTYPE html>
<html ng-app="plunker">

  <head>
    <meta charset="utf-8" />
    <title>AngularJS Plunker</title>
    <script>document.write('<base href="' + document.location + '" />');</script>
    <link rel="stylesheet" href="style.css" />
    <script data-require="angular.js@1.2.x" src="https://code.angularjs.org/1.2.28/angular.js" data-semver="1.2.28"></script>
    <script src="//cdn.rawgit.com/angular-ui/ui-grid.info/gh-pages/release/3.0.0-rc.20/ui-grid.min.js"></script>
    <script src="app.js"></script>
  </head>

  <body ng-controller="MainCtrl">
    <p>Hello {{name}}!</p>
  </body>

</html>

plnkr.co/edit/1tdcqDcgIS1ggwtPJivQ?p=preview检查这个plnkr,模块应该加载成功。你确定ui.grid.js没有获得404.检查开发控制台上的网络选项卡,确保下载文件。 -