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
98 声望5 粉丝

[链接]


引用和评论

0 条评论