Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 1.46 KB

README.md

File metadata and controls

57 lines (43 loc) · 1.46 KB

Angular Sortablejs directive

GitHub license npm scope

This package provides Angular binding for Storablejs which works with standard arrays as well as Angular FormArray objects.

Quick links

Installing

npm install --save nxt-sortablejs sortablejs

Import Sortablejs module

import { SortablejsModule } from 'nxt-sortablejs'

@NgModule({
    ...
    imports: [
        ...
        SortablejsModule
    ]
})

If you want to cofigure global Sortablejs options, include SortablejsModule.forRoot in your application.

import { SortablejsModule } from 'nxt-sortablejs'

@NgModule({
    ...
    imports: [
        ...
        SortablejsModule.forRoot({
            animation: 150
        })
    ]
})

Use it in a template

<ul [nxtSortablejs]="items">
    <li *ngFor="let item of items">{{ item }}</li>
</ul>