Angular2 Dropdown Component with NO DEPENDENCYS
ng2-simple-dropdown is a table grid component for Angular2/4.
Try it out: http://ng2-simple-dropdown.nicolaszick.com
[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
Install ng2-simple-dropdown via npm
npm install ng2-simple-dropdown --save
// app.module.tsimport{SimpleDropdownModule}from'ng2-simple-dropdown'; @NgModule({ ... imports: [SimpleDropdownModule] ... })exportclassAppModule{}// app.component.html<ng2-simple-dropdown[items]="items"[(ngModel)]="selectedItem"[defaultValue]="defaultText"></ng2-simple-dropdown>// app.component.tsimport{ Item }from'ng2-simple-dropdown';// ...exportclassAppComponent{savedFilter: Item[]=[];selectedFilter: Item;defaultSelectTextProfile='Profiles';constructor(){constdata={};this.savedFilter=[newItem('Profile1'),newItem('Profile2'),newItem('Profile3',data),newItem('Profile4',data),newItem('Profile5',data),newItem('Profile6',data),newItem('Profile7',data),newItem('Profile8',data),newItem('Profile9',data),newItem('Profile10',data),];}}
git clone https://github.com/nzick/ng2-simple-dropdown.git --depth 1 cd ng2-simple-dropdown npm install npm start
npm run build:lib
This project is licensed under the MIT license. See the LICENSE file for more info.