angular中的ng-repeat-start和ng-repeat-end的用法介绍

ng-repeat-start和ng-repeat-end是angular(1.2.X)的扩展,用于灵活的控制遍历

index部分:

<div class="item item-input-inset" **ng-repeat-start**="item in accessoryImg">
        <span class="input-label" ng-bind="i18n.accessory_label"></span> <!--附件-->
        <button class="button button-outline button-calm button-center" ng-bind="i18n.upload_accessory_btn"
                ng-click="accessory.click(item)"></button>                           <!--上传附件-->
      </div>
      <!--图片显示区域-->
      <div ng-show="item.src" class="addImage border-none pos-relative padding" **ng-repeat-end** >
        <img  ng-src="{{item.src}}" >
        <i ng-click="accessory.deleteAccessory(item)" class="icon ion-ios-close-outline pos-absolute font30 assertive deleteImg"></i>
      </div>

js部分

angular.module("app").controller("launchCtrl", ["$scope", 
  function ($scope) {
    "use strict";

    /*附件的内容*/
    $scope.accessoryImg = [
      {
        text: i18n.accessory_label, // 附件
        src: "",
        type: "accessoryInfo"
      }
    ];
    
  }
]);  
    原文作者:嘉恩Gavin
    原文地址: https://segmentfault.com/a/1190000009378072
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞