Coder Social home page Coder Social logo

shadowboxdev / ngx-drag-and-drop-grid Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexislaurier/ngx-drag-and-drop-grid

0.0 1.0 0.0 1.42 MB

A simple component for using the @angular/cdk drag-and-drop sort functions with a mixed orientation grid list

License: MIT License

JavaScript 12.24% TypeScript 77.35% HTML 6.47% CSS 3.94%

ngx-drag-and-drop-grid's Introduction

@sam-1994/ngx-drag-and-drop-grid Build Status

A simple component for using the @angular/cdk drag and drop sort functions with a mixed orientation grid list

Currently the package is only tested in combination with Angular 8.x

Table of Contents

Demo

https://sam-1994.github.io/ngx-drag-and-drop-grid/

Installation

First you need to install the npm module:

npm install @sam-1994/ngx-drag-and-drop-grid --save

Usage

1. Import the SamDragAndDropGridModule:

Finally, you can use ngx-translate in your Angular project. You have to import SamDragAndDropGridModule in the NgModule.

import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {SamDragAndDropGridModule} from '@sam-1994/ngx-drag-and-drop-grid';

@NgModule({
    imports: [
        BrowserModule,
        SamDragAndDropGridModule
    ],
    bootstrap: [AppComponent]
})
export class AppModule { }

2. Use the component:

import {Component, OnInit} from '@angular/core';
import {SamDragAndDropGridComponent} from 'drag-and-drop-grid-module';

@Component({
  selector: 'app-drag-and-drop-grid-example',
  templateUrl: './drag-and-drop-grid.component.html',
  styleUrls: ['./drag-and-drop-grid.component.sass']
})
export class SamDragAndDropGridExampleComponent implements OnInit {

  public list = [1, 2, 3, 4, 5, 6, 7, 8, 9];

  ngOnInit() {
  }
}
<sam-drag-and-drop-grid [items]="list" [columnNumber]="5">
  <div *samDragAndDropListData="let listItem; let i=index">
    Item {{listItem}}; Index {{i}}
  </div>
</sam-drag-and-drop-grid>

API

You can use the samDragAndDropListData directive to inject your custom template as grid items.

ngx-drag-and-drop-grid's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.