ng-swipe-to-delete
Material Swipe to delete list for Angular Projects.
Why ng-swipe-to-delete?
This module provides Four types of the listviews, so no need to write code for the listview again and again. With the help of this module, you can easily integrate list view having Swipe to delete feature. This module should work with all kind of screens width.
Demo
Check the Material Swipe to delete list in action, click here.
Installation
You can use either the npm or yarn command-line tool to install packages. Use whichever is appropriate for your project in the examples below.
Installation
You can use either the npm or yarn command-line tool to install packages. Use whichever is appropriate for your project in the examples below.
NPM
npm install --save ng-swipe-to-delete
YARN
yarn add --save ng-swipe-to-delete
Usage
Follow below steps to add multi level list in your project
1. Import NgSwipeToDeleteModule
You need to import the NgSwipeToDeleteModule
in the module of your app, where you want to use it.
;; /* Import the module*/; ;
<ng-swipe-to-delete>
in your HTML
2. Use In your HTML: Use the <ng-swipe-to-delete>
, wherever you like in your project.
3. Structure of array to display the list
Make sure, your structure of array should look like array shown below,
outgoingdata = ;
API
Using configuration
, different listview can be rendered. Although configuration
is optional, but then you will get simple list.
To render Listview with icons or Listview with Avatars use the below options.
-
slideThreshold: number
=> This is a percentage width. Once you slide more than a specified percentage(slideThreshold
) the list item will be removed. Basically, this will determine at what point the list item should be removed. If no value/Inavlid valid is given then it will consider the default value i.e. 12%. -
listType: string;
=> What type of list should be rendered. There are four option listed below. If you give any other input apart from below listed values, it will render the simple list view.- singleline
- multiline
- listwithicon
- listwithimage
-
classname: string;
=> [optional] You can give your own custom class name in order to modify the list appearance. -
disableWarnings: boolean;
=> [optional] To suppress the warnings in console. -
numberOfDeleteIcon: number;
=> [optional] It expects only two values either 1 or 2. It is used to hide the sweep delete icon on the right side of list item.
Dependencies
Contribution
I welcome you to fork and add more features into it. If you have any bugs or feature request, please create an issue at github repository.
Leicense
MIT