Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

fix(association-select): Properly load initial data

  • Loading branch information
RWOverdijk committed Dec 22, 2015
1 parent 829b349 commit 2a952b2344c11d3654f408ebb73f28652fcba61d
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/component/association-select.js
@@ -146,7 +146,8 @@ export class AssociationSelect {
return;
}

this.ownMeta = OrmMetadata.forTarget(this.entityManager.resolveEntityReference(this.repository.getResource()));
let initialValue = this.value;
this.ownMeta = OrmMetadata.forTarget(this.entityManager.resolveEntityReference(this.repository.getResource()));

if (this.manyAssociation) {
this.observe(this.manyAssociation);
@@ -155,6 +156,13 @@ export class AssociationSelect {
if (this.association) {
this.observe(this.association);
}

if (initialValue) {
this.load()
.then(() => {
this.value = initialValue;
});
}
}

/**

0 comments on commit 2a952b2

Please sign in to comment.