Code Monkey home page Code Monkey logo

ng2-simple-dropdown's Introduction

ng2-simple-dropdown

Angular2 Dropdown Component with NO DEPENDENCYS

ng2-simple-dropdown is a table grid component for Angular2/4.

Demo

Try it out: http://ng2-simple-dropdown.nicolaszick.com

Data

[items] can be an Object like the following:

this.savedFilter = [
      {
        name: 'Profile1', 
        any: {}
      }
]

[defaultValue] can be a String like the following:

this.defaultSelectTextProfile = "Please Select";

[isEditable] can be a boolean and defined if dropdown values can be changed

Installation

Install ng2-simple-dropdown via npm

npm install ng2-simple-dropdown --save

Integration

// app.module.ts
import { SimpleDropdownModule } from 'ng2-simple-dropdown';

@NgModule({
  ...
  imports: [ SimpleDropdownModule ]
  ...
})
export class AppModule { }

// app.component.html
<ng2-simple-dropdown [items]="items" [(ngModel)]="selectedItem" [defaultValue]="defaultText"></ng2-simple-dropdown>

// app.component.ts
import { Item } from 'ng2-simple-dropdown';

// ...

export class AppComponent {
  savedFilter: Item[] = [];
  selectedFilter: Item;
  defaultSelectTextProfile = 'Profiles';

  constructor() {
    const data = { };
    this.savedFilter = [
      new Item('Profile1'),
      new Item('Profile2'),
      new Item('Profile3', data),
      new Item('Profile4', data),
      new Item('Profile5', data),
      new Item('Profile6', data),
      new Item('Profile7', data),
      new Item('Profile8', data),
      new Item('Profile9', data),
      new Item('Profile10', data),
    ];
  }
}

Run Included Demo

git clone https://github.com/fbele/ng2-simple-dropdown.git --depth 1
cd ng2-simple-dropdown
npm install
npm start

AoT Library Build

npm run build:lib

Licence

This project is licensed under the MIT license. See the LICENSE file for more info.

ng2-simple-dropdown's People

Contributors

nzick avatar fbele avatar

Watchers

Tobias Struckmeier avatar 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.