Permalink
Browse files

feat(component): association select with identifier bindable

  • Loading branch information...
bas080
bas080 committed Jul 1, 2016
1 parent 03da621 commit 9f675540c18f676f3dc94cdf6e2f31efc62753b9
Showing with 8 additions and 1 deletion.
  1. +1 −0 config.js
  2. +1 −0 package.json
  3. +6 −1 src/component/association-select.js
@@ -18,6 +18,7 @@ System.config({
"aurelia-validation": "npm:aurelia-validation@0.6.6",
"extend": "npm:extend@3.0.0",
"fetch": "github:github/fetch@1.0.0",
"get-prop": "npm:get-prop@0.0.10",
"typer": "npm:typer@1.1.0",
"npm:aurelia-api@3.0.0-rc4": {
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.2.3",
@@ -51,6 +51,7 @@
"aurelia-templating": "^1.0.0-beta.1.2.7",
"aurelia-validation": "0.6.6",
"extend": "^3.0.0",
"get-prop": "^0.0.10",
"typer": "^1.1.0"
},
"devDependencies": {
@@ -1,3 +1,4 @@
import getProp from 'get-prop';
import {logger} from '../logger';
import {inject} from 'aurelia-dependency-injection';
import {bindingMode, BindingEngine} from 'aurelia-binding';
@@ -14,6 +15,8 @@ export class AssociationSelect {
@bindable repository;
@bindable identifier;
@bindable property = 'name';
@bindable resource;
@@ -73,7 +76,9 @@ export class AssociationSelect {
}
if (!Array.isArray(value)) {
this.value = value;
this.value = (typeof value === 'object') ?
getProp(value, this.identifier || 'id') :
value;
return;
}

0 comments on commit 9f67554

Please sign in to comment.