[英]AngularJS ngGrid module declaration
I've been messing around with Angular and have a simple test project with working however when adding in the module for ngGrid, everything just stops functioning. 我一直在搞乱Angular并且有一个简单的测试项目,但是在为ngGrid添加模块时,一切都停止运行。
A snippet of working HTML is: 一段工作HTML是:
<div class="navbar-header">
<a class="navbar-brand" ui-sref="home">{{hdr.title}}</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li ng-click="hdr.setIndex(0)" ng-class="(index==0) ? 'active' : ''">
<!--<a href="#">Contributions</a>-->
<!--STATE directive-->
<a ui-sref="{{hdr.menu[0].state}}">{{hdr.menu[0].name}}</a>
<!--<a ui-sref="collections">{{hdr.menu[0].name}}</a>-->
</li>
<li ng-click="hdr.setIndex(1)" ng-class="(index==1) ? 'active' : ''">
<a ui-sref="{{hdr.menu[1].state}}">{{hdr.menu[1].name}}</a>
</li>
<li ng-click="hdr.setIndex(2)" ng-class="(index==2) ? 'active' : ''">
<a ui-sref="{{hdr.menu[2].state}}">{{hdr.menu[2].name}}</a>
</li>
<!--<li><a href="#"> {{hdr.title}}</a></li>-->
</ul>
</div>
The script contains: 该脚本包含:
angular.module('app', ['ui.router'])
The display fails when the script is updated to either of the following: 当脚本更新为以下任一项时,显示失败:
angular.module('app', ['ui.router','ngGgrid'])
angular.module('app', ['ngGgrid'])
Now instead of the page displaying properly, all that displays is: 现在,所有显示的内容都是:
{{hdr.title}} {{hdr.menu[0].name}} {{hdr.menu[1].name}} {{hdr.menu[2].name}}
The script file is being loaded with: 正在加载脚本文件:
<script src="Scripts/ng-grid.js"></script>
Thanks in advance for any responses. 提前感谢您的回复。
基于K Scandrettt的回复的另一个关键字搜索使我能够找到另一个包含我的问题解决方案的帖子 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.