<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>

最新文章

  1. 一道关于java序列化的问题,看大家知多少————
  2. ORA-01012: not logged on
  3. mac os 下搭建android开发环境
  4. mysql binlog日志查看及解码
  5. webapi 中使用 protobuf
  6. 注解学习(模仿springMvc的注解注入方式)
  7. Struts2标签实现for循环
  8. nginx限制ip请求次数 以及并发次数
  9. CSDN首页&gt; 移动开发 直接拿来用!最火的Android开源项目(完结篇)
  10. 国内国外最好的java开发论坛及站点 [转]
  11. MSSQL - SqlDataAdapter连接数据库提高性能用法
  12. ASP.NET Core中的OWASP Top 10 十大风险-SQL注入
  13. eclipse导入包之后中文乱码
  14. WP-player——WordPress的一款好用的音乐插件
  15. SpringBoot 同时整合thymeleaf html、vue html和jsp
  16. Can&#39;t connect to X11 window server using &#39;:1.0&#39; as the value of the DISPLAY variable.
  17. Vmware10中Centos7挂载Windows主机的共享文件夹,提示:Error: cannot mount filesystem: No such device
  18. 可视化n次贝塞尔曲线及过程动画演示--大宝剑
  19. 每天学点SpringCloud(十):SpringCloud监控
  20. solr7.3.1在CentOS7上的安装

热门文章

  1. 【原】linux系统运维工具必备
  2. ee
  3. jsp页面List迭代
  4. JavaScript对象的创建之基于原型方式
  5. 解决Git报错:The current branch is not configured for pull No value for key branch.master.merge found in configuration
  6. opencv基于HSV的肤色分割
  7. Ogre参考手册(五)3.2 合成器
  8. Azure磁盘的吞吐量测试
  9. 洛谷P1467 循环数 Runaround Numbers
  10. 洛谷P1198 [JSOI2008]最大数