Onsen UI Carousel Swipe list item

拈花ヽ惹草 提交于 2019-12-06 10:20:48

You should supply some code so we can see what you've tried. Are you using the ngRepeat directive and a <ons-list>? In that case you should just remove the item from the data array.

In a controller you create a list of items (can be anything):

angular.module('myApp').controller('MyController', function($scope) {
  $scope.items = ['A', 'list', 'of', 'items'];
});

In your HTML you use ngRepeat to loop through them. To remove an item use ngClick and splice the list.

<ons-list>
  <ons-list-item ng-repeat="item in items">
    {{ item }}
    <ons-button ng-click="items.splice($index, 1)">Remove item</ons-button>
  </ons-list-item>
</ons-list>

I've used carousel in the following example, but it shouldn't really matter what you put in your list. http://codepen.io/argelius/pen/qEmjEB

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