<div ng-app ng-controller='StudentListController'>
<ul>
<li ng-repeat='student in students'>
<a href='/student/view/{{student.id}}'>{{student.name}}</a>
</li>
</ul>
<button ng-click="insertTom()">Insert</button> <br /> <table class="table-bordered" ng-controller='AlbumController'>
<tr ng-repeat='track in album'>
<td>{{$index + 1}}</td>
<td>{{track.name}}</td>
<td>{{track.duration}}</td>
</tr>
</table>
</div> <script src="~/Scripts/angular.js"></script>
<script>
var students = [{ name: 'Mary Contrary', id: '1' },
{ name: 'Jack Sprat', id: '2' },
{ name: 'Jill Hill', id: '3' }];
function StudentListController($scope) {
$scope.students = students;
$scope.insertTom = function () {
$scope.students.splice(1, 0, { name: 'Tom Thumb', id: '4' });
};
} var album = [{ name: 'Southwest Serenade', duration: '2:34' },
{ name: 'Northern Light Waltz', duration: '3:21' },
{ name: 'Eastern Tango', duration: '17:45' }];
function AlbumController($scope) {
$scope.album = album;
}
</script>

Generate List and Table via ng-repeat的更多相关文章

  1. golang学习笔记12 beego table name `xxx` repeat register, must be unique 错误问题

    golang学习笔记12 beego table name `xxx` repeat register, must be unique 错误问题 今天测试了重新建一个项目生成新的表,然后复制到旧的项目 ...

  2. Part 6 AngularJS ng repeat directive

    ng-repeat is similar to foreach loop in C#. Let us understand this with an example. Here is what we ...

  3. table sorting–angularjs

    1: <script type="text/javascript" ng:autobind 2: src="http://code.angularjs.org/0. ...

  4. [转]Repeat Page Header on each Page for reports SSRS

    本文转自:https://stackoverflow.com/questions/3475144/i-want-to-repeat-page-header-on-each-page-for-repor ...

  5. BitHacks

    备份文件时看到的.我以前居然下过这东西. 2016-12-4 12:05:52更新 纯文本格式真棒.假如使用word写的我能拷过来格式还不乱?? Markdown真好. Bit Hacks By Se ...

  6. [译]用AngularJS构建大型ASP.NET单页应用(三)

    原文地址:http://www.codeproject.com/Articles/808213/Developing-a-Large-Scale-Application-with-a-Single A ...

  7. Java生成动态GIF图片

    写selenium自动化时,为了查看运行效果,后给浏览器截图,想到可以生成gif图片来快速预览.看到已经有人实现了,直接拿过来. 共涉及到三个java文件,分别是NeuQuant.java,LZWEn ...

  8. android 开发 对图片编码,并生成gif图片

    demo场景: 将2张静态的png格式图片组合生成一个gif图片,间隔500毫秒,关键类:AnimatedGifEncoder 如需要解析gif获取每帧的图片,可参考上一篇博客:<android ...

  9. Bit Twiddling Hacks

    http://graphics.stanford.edu/~seander/bithacks.html Bit Twiddling Hacks By Sean Eron Andersonseander ...

随机推荐

  1. 【转】nginx服务器安装及配置文件详解

    原文:http://seanlook.com/2015/05/17/nginx-install-and-config/ nginx服务器安装及配置文件详解 nginx在工作中已经有好几个环境在使用了, ...

  2. 【转】maven POM.xml 标签详解

    http://blog.csdn.net/sunzhenhua0608/article/details/32938533 pom作为项目对象模型.通过xml表示maven项目,使用pom.xml来实现 ...

  3. UIButton 详解

    1)创建 UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 风格有如下 typedef enum { UIButt ...

  4. Bootstrap 3 How-To #2 标题,链接与按钮

    这个系列的要点来自一本名为 Twitter Bootstrap Web Development How-to 的书,但是,这本书的内容是基于以前版本的,与最新的 3.0 并不一致. 为了方便学习和使用 ...

  5. windows常用运行命令收集(持续更新)

    快捷键打开运行窗口:Windows + R > calc(计算器) > gpedit.msc(本地组策略编辑器) > regedit(注册表) > mstsc(远程桌面) &g ...

  6. 007 The Inheritance In JAVA

    在JAVA中有一个特型叫继承(Inheritance),通过继承我们可以重复使用代码,令代码简洁,易于扩展.例如:有一个sharp的类,这个类实现了sharp的一些方法,现在我们要写一个circle的 ...

  7. 初探接口测试框架--python系列2

    点击标题下「蓝色微信名」可快速关注 坚持的是分享,搬运的是知识,图的是大家的进步,没有收费的培训,没有虚度的吹水,喜欢就关注.转发(免费帮助更多伙伴)等来交流,想了解的知识请留言,给你带来更多价值,是 ...

  8. THE ONE THING PEOPLE WILL MASSIVELY OVERPAY FOR (有一个东西人们是愿意出高价购买的)

    THE ONE THING PEOPLE WILL MASSIVELY OVERPAY FOR有一个东西人们是愿意出高价购买的 by GARY VAYNERCHUK 点此直达湾区日报简评 I don' ...

  9. 【练习】显示MYSQL客户机选项

    [oracle@enmo ~]$ mysql --help mysql Ver , for Linux (x86_64) using EditLine wrapper Copyright (c) , ...

  10. Decks

    Now that we have Card objects, the next step is to define a class to represent decks. Since a deck i ...