ng-repeat是angular的一个指令,用来循环生成某些东西。常用的是拿到数据循环生成样式展示在视图中。

<!--orderStatuses表示$scope传递的数据$scope.orderStatuses=data;data是json对象格式-->
<select name="aaa" id="aaa" ng-model="$scope绑定的变量"></select>
<option ng-repeat="status in orderStatuses" value="{{status.key}}">{{status.value}}</option> <!--有三种ng-repeat方式,根据数据格式来使用哪种方式-->
<tr ng-repeat="x in records">
<td>{{x.Name}}</td>
<td>{{x.Country}}</td>
</tr>
<tr ng-repeat="(x, y) in myObj">
<td>{{x}}</td>
<td>{{y}}</td>
</tr>
<!--第3种方式:x in records track by $id(x)-->

angular的ng-repeat使用的更多相关文章

  1. Angular: 执行ng lint后如何快速修改错误

    当我第一次被分配到“修正执行ng lint语句后的错误”这项任务前,我就被导师提前告知这是一个很无聊的任务,当我开始后,我发现其实有一些办法可以加快这个无聊单调的工作.接下来,我就分享一下我的经验. ...

  2. ANGULAR 使用 ng build --prod 编译报内存错误的解决办法

    如果你遇到如下的情况 <--- Last few GCs ---> [13724:0000020D39C660D0] 231298 ms: Mark-sweep 1356.3 (1433. ...

  3. Angular CLI ng常用指令整理

    一.组件创建 ng generate component heroes 二.运行项目 ng serve --open //--open 立即打开 三.创建指令 ng g directive my-ne ...

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

  5. angular自定义指令 repeat 循环结束事件;limitTo限制循环长度、限定开始位置

    1.获取repeat循环结束: 自定义指令: .directive('repeatFinish', function () { return { link: function (scope, elem ...

  6. angular Error: [ng:areq]

    在使用augularjs的时候,爆了个错误: 后来经过对比,原来是我的<html>标签多了点东西

  7. Angular源代码学习笔记-原创

    时间:2014年12月15日 14:15:10 /** * @license AngularJS v1.3.0-beta.15 * (c) 2010-2014 Google, Inc. http:// ...

  8. Angular实现递归指令 - Tree View

    在层次数据结构展示中,树是一种极其常见的展现方式.比如系统中目录结构.企业组织结构.电子商务产品分类都是常见的树形结构数据. 这里我们采用Angular的方式来实现这类常见的tree view结构. ...

  9. 大话ASP.NET(第二篇,Angular结构篇--翻译)

    AngularJS API Docs Welcome to the AngularJS API docs page. These pages contain the AngularJS referen ...

  10. 前端开发环境搭建 Grunt Bower、Requirejs 、 Angular

    现在web开发的趋势是前后端分离.前端采用某些js框架,后端采用某些语言提供restful API,两者以json格式进行数据交互. 如果后端采用node.js,则前后端可以使用同一种语言,共享某些可 ...

随机推荐

  1. imx6 matrix keyboard

    imx6需要添加4x4的矩阵键盘.本文记录添加方法. 参考链接 http://processors.wiki.ti.com/index.php/TI-Android-JB-PortingGuide h ...

  2. 记在virtualbox下挂载共享文件夹的方法

    sudo mount -t vboxsf share /usr/share sudo mount -t vboxsf 共享文件夹名称(在设置页面设置的) 挂载的目录

  3. git操作的常用命令

    git remote show origin 查看git远程信息git remote set-url origin git@gitlab.staff.xdf.cn:woxue/woxueadmin.g ...

  4. Jquery生成树 ztree

    参考http://www.cnblogs.com/lvchenfeng/p/5295805.html

  5. 基于jquery封装通用的控制显示隐藏的方法

    应用场景 在项目中会存在大量这样的需求: 1.选择不同的radio单选框,页面上的部分内容随之显示隐藏 2.选择不同的option下拉框内容,页面上的部分内容随之显示隐藏 如果每次遇到这类需求都单独写 ...

  6. C++笔记(二)------ 头文件

    类似#include<string>与#include<string.h>等头文件的区别 标准的C++头文件没有.h扩展名,带有.h的头文件一般都是C语言的.例如#includ ...

  7. SQL-2008函数大全

    SQL Server 2008 函数大全(完整版) SQL2008 表达式:是常量.变量.列或函数等与运算符的任意组合.1. 字符串函数 函数 名称 参数 示例 说明 ascii(字符串表达式) se ...

  8. 第二天 ado.net, asp.net ,三层笔记

    1. ado.net步骤:     一:倒入命名空间      using System.Data;      using System.Data.sqlclient;     二:第一个模型 int ...

  9. c#:如何处理对对象进行深度拷贝

    /// <summary> /// 对对象进行深度拷贝 /// </summary> /// <param name="obj"></pa ...

  10. SQLServer数据库监控代码

    SQLServer数据库监控代码: creation_time, total_worker_time, last_worker_time, max_worker_time, min_worker_ti ...