Giter Site home page Giter Site logo

yuzhang001 / angular2-widgets-manager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bargoldi/angular2-widgets-manager

0.0 1.0 0.0 206 KB

Angular2 dynamic components grid, based on widgets concept

License: MIT License

TypeScript 58.18% JavaScript 39.21% HTML 2.62%

angular2-widgets-manager's Introduction

angular2-widgets-manager

Angular2 dynamic components grid, based on widgets concept.

Usage

First, installation:

$ npm install angular2-widgets-manager

Now, in order to use it you will probably need to configure it as UMD (for SystemJS/Webpack). So don't forget to include the main file:

node_modules/angular2-widgets-manager/dist/main.js

Here's a code example to add it in your AppModule:

import { NgModule } from '@angular/core';
import { WidgetsManagerModule } from '../../src/main';
import { WidgetsManagerService } from '../../src/widgets-manager.service';

@NgModule({
  imports: [WidgetsManagerModule.forRoot()],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule {
  constructor() {
    // This line is important as it passes YOUR module, the one
    // from which the manager will get the widgets components
    WidgetsManagerService.provideWidgetsModule(WidgetComponentsModule.forRoot());
  }
}
<widgets-grid (onDragStart)="doSomethingOnDragStart($event)"
              [componentsDetails]="componentsDetails"
              [gridConfig]="gridConfig"></widgets-grid>

Configuration

Grid configuration

You can find NgGridConfig in angular2-grid

Widgets configuration - Component Details

interface ComponentDetails {
    id?: string | number;
    name: string;
    html: string;
    gridItemConfig: NgGridItemConfig;
}

You can find NgGridItemConfig in angular2-grid

Credits

angular2-widgets-manager's People

Contributors

bargoldi avatar wseng avatar

Watchers

 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.