Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jinhduong/ng2-choices
Angular multi choices simples
https://github.com/jinhduong/ng2-choices
Last synced: 8 days ago
JSON representation
Angular multi choices simples
- Host: GitHub
- URL: https://github.com/jinhduong/ng2-choices
- Owner: jinhduong
- License: mit
- Created: 2017-07-11T07:43:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-14T03:52:24.000Z (over 7 years ago)
- Last Synced: 2024-10-13T13:23:26.384Z (2 months ago)
- Language: TypeScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ng2-choices
The simplest library for multiple choices in Angular.
- No dependencies
- Simplest![http://i.imgur.com/AerIXxA.png](http://i.imgur.com/AerIXxA.png)
## 1. Install
`npm install ng2-choices --save`## 2. Using
### **2.1 .html**
```html
```
### **2.2 .component**
```js
choices: ChoiceModel[] = [
{ title: 'Angular', checked: false },
{ title: 'React', checked: false },
{ title: 'Vue', checked: false },
{ title: 'Ember', checked: false },
{ title: 'Preact', checked: false },
{ title: 'Aurelia', checked: false }
];
```### **2.3 .app.module**
```js
import { Ng2ChoicesComponent } from './ng2-choices/build';@NgModule({
declarations: [
AppComponent,
Ng2ChoicesComponent
],
imports: [
...
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
```### **options**
Default options```js
options = {
multiple: true
};
```### **events/ functions**
`change(item)`: Will fire whenever you checked/unchecked any items.
- *item*: item which is checking/ un-checking.