ng2-material-select
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -7,2 +7,3 @@ import { EventEmitter } from '@angular/core'; | ||
displayBy: string; | ||
selectedDisplayBy: string; | ||
identifyBy: string; | ||
@@ -13,2 +14,3 @@ multiple: boolean; | ||
getSelectedValue(): any; | ||
selectedDisplayValue(item: any): string; | ||
displayValue(item: any): string; | ||
@@ -15,0 +17,0 @@ readonly placeholderDisplay: string; |
{ | ||
"name": "ng2-material-select", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Angular 2 material-like Select Component", | ||
@@ -68,3 +68,3 @@ "scripts": { | ||
"equals": "^1.0.5", | ||
"ng2-material-dropdown": "0.3.6" | ||
"ng2-material-dropdown": "0.3.8" | ||
}, | ||
@@ -79,3 +79,3 @@ "keywords": [ | ||
"type": "git", | ||
"url": "https://github.com/Gbuomprisco/ng2-select-material" | ||
"url": "https://github.com/Gbuomprisco/ng2-material-select" | ||
}, | ||
@@ -82,0 +82,0 @@ "bugs": { |
@@ -49,5 +49,7 @@ # Angular2 Material Select | ||
In case you want to use objects instead of simple arrays, you might want to use 2 further options: | ||
In case you want to use objects instead of simple arrays, you might want to use 3 further options: | ||
- **`displayBy`** - defines the key for displaying the value of the item | ||
- **`?selectedDisplayBy`** - optional, defines the key for displaying the value once an item is selected | ||
- **`?identifyBy`** - optional, it is useful in case there is the possibility to have items with duplicate values (ex. two items with the same name). In that case, you can defined another key (ex. id) to correctly identify the item. Also, this allows the component to use `trackBy` | ||
@@ -61,4 +63,5 @@ | ||
<ng2-select [placeholder]="'Choose your framework'" | ||
[displayBy]="name" | ||
[identifyBy]="name" | ||
[displayBy]="'name'" | ||
[selectedDisplayBy]="'label'" | ||
[identifyBy]="'name'" | ||
[options]="options" | ||
@@ -83,2 +86,3 @@ [(ngModel)]="framework"> | ||
name: 'Angular2', | ||
label: 'ng2', | ||
id: 0 | ||
@@ -88,2 +92,3 @@ }, | ||
name: 'React', | ||
label: 'rx', | ||
id: 1 | ||
@@ -90,0 +95,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
174920
2060
99
+ Addedng2-material-dropdown@0.3.8(transitive)
- Removedng2-material-dropdown@0.3.6(transitive)
Updatedng2-material-dropdown@0.3.8