嵌套的ng-repeat onclick ng-file-uploads angular js无效?

时间:2016-03-14 06:15:44

标签: angularjs angularjs-ng-repeat ng-file-upload

我无法在嵌套的ng-repeat中上传云文件上传?这是我的代码。

 <div ng-repeat='itemchild in item.childCmnts track by $index'>
  <section class="top">
      <h6 class="byline"><img class="round-small-img" ng-src="{{itemchild.user.profile_pic}}"  ng-class="(war.topics[0].voted == true) ? '' : 'float-right'">
 <a href="#" class="warowner-name-section" ng-class="(war.topics[0].voted == true) ? '' : 'float-right alignmentchild'">{{itemchild.user.first_name}} {{itemchild.user.last_name}}<span class="owner-date">{{itemchild.created_at |amDateFormat:'MMM DD [at] LT'}}<span></span></span></a>
  </h6>
  </section>
 <div ng-show="itemchild.img">
 <img class="cmntImg" cl-src="{{itemchild.img}}" />
  </div>

  <p  class="comments-content-section">{{itemchild.message}}</p>
    <div class="line padd-top"></div>
     <div class="top-bar-left">
        <ul class="menu4">
            <li><a href="#">upvote {{itemchild.upVoteCount}}</a></li>
               </ul>
     </div>
     <div class="clearfix"></div>
          <div class="line padd-top1"></div>
  </div>
  <div ng-show="showreplybox(item._id)" class="reply-box">
      <div class="row">
            <div class="medium-1 small-2 columns">
<img ng-src="$root.user.profile_pic}}" class="round-small-img">
   </div>
<div class="medium-11 small-10 columns">
<input type="text" ng-model="$parent.subcmnt" class="style-box" placeholder="Write a reply.."/>
 <a ngf-resize="{width: 150, height: 150, quality: 1}" ng-model="file" ngf-select="upload($file)"> <img class="upload-icon" src="assets/upload-icon.png"/> </a>
<a class="reply-button" ng-click="postReplyForTop(item._id)">Reply</a>
</div>
 <div class="small-12 small-centered column preview" ng-show="file">
  <div class="preview-section">
 <img class="preview-image" ngf-thumbnail="file">
 </div>

  </div>
 </div>
  </div>

上面的代码,我试图使用ngf-select在嵌套的ng-repeat itemchild循环中上传文件。但是当我尝试在$ scope.file中访问控制器中的文件时。它显示未定义。
请帮我解决一下?

0 个答案:

没有答案