https://github.com/nzick/ng2-simple-dropdown
Angular4 Simple Dropdown Component without any dependency
https://github.com/nzick/ng2-simple-dropdown
angular angular2 angular4 angular4-component dropdown dropdown-menus
Last synced: 3 months ago
JSON representation
Angular4 Simple Dropdown Component without any dependency
- Host: GitHub
- URL: https://github.com/nzick/ng2-simple-dropdown
- Owner: nzick
- License: mit
- Created: 2017-05-17T09:14:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-23T13:50:46.000Z (over 8 years ago)
- Last Synced: 2024-10-30T06:40:41.492Z (about 1 year ago)
- Topics: angular, angular2, angular4, angular4-component, dropdown, dropdown-menus
- Language: TypeScript
- Homepage:
- Size: 251 KB
- Stars: 3
- Watchers: 1
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](http://ng2-simple-dropdown.nicolaszick.com)
## Data
`[items]` can be an Object like the following:
```js
this.savedFilter = [
{
name: 'Profile1',
any: {}
}
]
```
`[defaultValue]` can be a String like the following:
```js
this.defaultSelectTextProfile = "Please Select";
```
`[isEditable]` can be a boolean and defined if dropdown values can be changed
## Installation
Install ng2-simple-dropdown via `npm`
````shell
npm install ng2-simple-dropdown --save
````
## Integration
```ts
// app.module.ts
import { SimpleDropdownModule } from 'ng2-simple-dropdown';
@NgModule({
...
imports: [ SimpleDropdownModule ]
...
})
export class AppModule { }
// app.component.html
// 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
```shell
git clone https://github.com/nzick/ng2-simple-dropdown.git --depth 1
cd ng2-simple-dropdown
npm install
npm start
```
## AoT Library Build
```shell
npm run build:lib
```
## Licence
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.