Change picture from already selected pictures in Angular JS

☆樱花仙子☆ 提交于 2019-12-12 03:53:48

问题


Initially there will be set of images at left and right. if i click set image on left side. it will be moved to right side. right side column will show the selected pictures, left side column shows unselected pictures. i will be able to select 5 pictures at a time and submit it. if i click submit button those 5 images will be shown in another page,post request will be sent to server.there will be one button in that page called change picture button. if i click that , i need already selected images to be shown at another page of right hand side column.

Here is the plunker link https://plnkr.co/edit/BM4AavLn9uKxKL4wdbT6?p=preview

 <body ng-controller="myController">
<div class="row">
  <div class="col-xs-6 col-sm-5 col-md-5">
    <h3 style="text-align: center;text-shadow: 0px 4px 6px;">All Pictures</h3>
    <div class="row" ng-repeat="media in pinMedia">
      <!-- pin.media_id!=media._id || -->
      <div class="col-xs-12 col-sm-12 col-md-5">
        <img ng-src="http://placehold.it/{{images}}" width="200px" />
        <p>{{media.Name}}</p>
        <div class="col-xs-12 col-sm-12 col-md-5">
          <button ng-disabled='limit()' class="btn btn-success" style="border: .0625rem solid transparent;padding: .465rem 1rem;" ng-click="toselected(media)">
            <i class="fa fa-picture-o"></i>
 Set Picture</button >
        </div>
      </div>
    </div>
  </div>
  <div class="col-xs-6 col-sm-5 col-md-5">
    <h3 style="text-align: center;text-shadow: 0px 4px 6px;">Selected Pictures</h3>
    <div ng-repeat="media in selected">
      <!-- pin.media_id==media._id && -->
      <div>
        <img ng-src="http://placehold.it/{{images}}" width="200px" />
        <p>{{media.Name}}</p>
        <div>
          <a class="btn btn-success " style="border: .0625rem solid transparent;padding: .465rem 1rem;" ng-click="tosource(media)">
            <i class="fa fa-picture-o"></i>
 Remove Picture</a>
        </div>
      </div>
    </div>
  </div>
 <button ng-click="setMediaForCurrentPin(selected)" class="btn btn-success" style="margin:50px auto; display:table;">Submit</button>
</div>

来源:https://stackoverflow.com/questions/34923006/change-picture-from-already-selected-pictures-in-angular-js

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!