New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ngx-reorder

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-reorder

Angular Directive To Reorder Elements.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

ngx-reorder

Angular Directive To Reorder Elements.

Live Demo : https://mraghuram3.github.io/#/ngx-reorder

Installation

To install this library, run:

$ npm install ngx-reorder --save

Usage

Import NgxReoderModule in the root module

import { NgxReoderModule } from 'ngx-reorder';

@NgModule({
  imports: [
    // ...
    NgxReoderModule,
    ...
  ]
})

In your template

  <div class="dragParn" ngxReorder [items]="dataSort" (sortedData)="dataSort = $event;" (dropTarget)="target = $event;" (dragStart)="startIndex = $event;">
    <div class="drag" ngxReorderElement *ngFor="let r of dataSort;let i = index" [index]="i" [ngClass]="{'border':target == i,'opacity':startIndex == i}"> {{r?.text}}</div>
  </div>
  • ngxReorder

    Add the directive to the div or other dom in which the elemnts are to be Reordered

  • [items]: any[]

    TThe data which are to be sorted.

  • (sortedData)="dataSort = $event;":

    Whenever the elements are reorderd the sorted data output is fired and the data int he array is updated.

  • (dropTarget)="target = $event;":

    Target index to apply css class to the target element.

  • (dragStart)="startIndex = $event;":

    Start Index is the elements which is being dragged, to apply css.

target = -1;
startIndex = -1;
.....
......
  • ngxReorderElement

    Add the directive to the div for row elements which are to be reorderd.

  • [index]: number.

    To uniquely identify the elements.

** include other inputs in ngxReorderElement row, like ngFor, index and [ngClass] **

License

MIT © Raghu Ram M

Keywords

FAQs

Package last updated on 28 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc