栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

ng-repeat-start与ng-repeat的意义

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ng-repeat-start与ng-repeat的意义

这两个指令的含义相似:它们重复HTML标记。所不同的只是,在

ng-repeat-start
您的帮助下,您可以重复几个标签,从标签开始于
ng-repeat-start
,再到完成于
ng-repeat-end

例如,您有下一个代码:

<div>  Item # {{item}}</div><div>Whether you repeat me?</div>

因此,现在我们可以为这些代码添加2个指令。

ng-repeat

<div ng-repeat="item in items">  Item # {{item}}</div><div>  This pre will not be repeated</div>

ng-repeat-start
ng-repeat-end


<div ng-repeat-start="item in items">  Item # {{item}}</div><div ng-repeat-end="">This pre will be repeated</div>

因此,现在您可以看到,在第一种情况下,仅

div
使用
ng-repeat
指令重复,但是在第二种情况下,您的
div
s都会重复。

您可以看到演示并使用它:

演示:http://plnkr.co/edit/R778lWTABVF3Hy16CAca



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/403837.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号