<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. 文件处理函数fopen、fread、fseek、fclose的使用实例介绍

    FILE文件流用于对文件的快速操作,主要的操作函数有fopen.fseek.fread.fclose,在对文件结构比较清楚时使用这几个函数会比较快捷的得到文件中具体位置的数据,提取对我们有用的信息,满 ...

  2. Eclipse Gtk+

    From: http://hi.baidu.com/spmno/item/9425018707f295dfd1f8cdbe 1. Project->Properties,然后选 C/C++ Bu ...

  3. 基于jQuery的web在线流程图设计器GooFlow

    简易的流程图设计控件,效果图: JavaScript源文件在GooFlow.js中,样式文件是GooFlow2.css.可以自定义样式. GooFlow_item类是每个项的样式属性. 但估计实现任务 ...

  4. JavaScript内置对象

    对象概述 JavaScript是一种基于对象的脚本语句,而不是面向对象的编程语言.对象就是客观世界存在的实体,具有属性和方法两方面特性. 访问对象的属性和方法的方式如下: 对象名.属性 对象名.方法名 ...

  5. How to deploy JAVA Application on Azure Service Fabric

    At this moment, Azure Service Fabric does not support JAVA application natively (but it's on the sup ...

  6. Windows Azure - App Services

    1. 需要了解的概念:App Service Plan, Resource Group 2. Create an ASP.NET web app in Azure App Services 3. Cr ...

  7. 父窗口调用iframe子窗口方法

    一.父窗口调用iframe子窗口方法 1.HTML语法:<iframe name="myFrame" src="child.html"></i ...

  8. 使用扩展方法(this 扩展类型)

    namespace ConsoleApp_UseExtendWays{ class Program { static void Main(string[] args) { Student s = ne ...

  9. OpenLDAP 安装及配置 笔记

    首先下载 OpenLdap(Ldap服务器) 和 LdapAdmin(客户端) 两个软件 OpenLDAPforWindows_2.4.39.part1.rar OpenLDAPforWindows_ ...

  10. Linux 命令之 grep

    1:将/etc/passwd中有root字符的行显示出来 [root@bogon zkero]# grep -n 'root' /etc/passwd :root:x:::root:/root:/bi ...