zoukankan      html  css  js  c++  java
  • angular中的方法ng-repeat的是使用

    <!DOCTYPE html>
    <html>
    <head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="angular-1.5.8.js"></script>
    </head>
    <body>
    <!--//1.0data是一个纯数值的时候:[ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]-->
    <!--<div ng-app ng-init="data=[ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]">-->
    <!--<div ng-repeat="key in data">-->
    <!--<div>{{key}}</div>-->
    <!--</div>-->
    <!--</div>-->


    <!--//2.0data是一个对象的时候:{name:"小明", age:15, sex:"" }-->
    <!--<div ng-app ng-init="data={name:'小明', age:15, sex:'' }" >-->
    <!--<div ng-repeat="(k,value) in data">-->
    <!--<div>{{k}}</div>-->
    <!--<div>{{value}}</div>-->
    <!--</div>-->
    <!--</div>-->
    <script>
    // 1.0data是一个纯数值的时候:[ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
    // 2.0data是一个对象的时候:{name:'小明', age:15, sex:'' }
    //ng-repeat:
    // 将一个集合( 数组, 键值对 )进行遍历( for遍历, for-in遍历 )
    // 一般该指令放在特定的标签中, 凡是使用该指令的标签会被重复的创建, 并填充指定的数据
    // 一般使用 的 tr, li, div
    //语法:
    // ng-repeat=" in 数组 "
    // ng-repeat=" ( , ) in 对象 "
    // 例如要重复 div
    // <div ng-repeat="v in list"></div>
    </script>

    </body>
    </html>
  • 相关阅读:
    城市的划入划出效果
    文本溢出省略解决笔记css
    长串英文数字强制折行解决办法css
    Poj 2352 Star
    树状数组(Binary Indexed Trees,二分索引树)
    二叉树的层次遍历
    Uva 107 The Cat in the Hat
    Uva 10336 Rank the Languages
    Uva 536 Tree Recovery
    Uva10701 Pre, in and post
  • 原文地址:https://www.cnblogs.com/liubaichi/p/6051280.html
Copyright © 2011-2022 走看看