Skip to content

Commit

Permalink
feat(plugins): update to use new metadata locator function
Browse files Browse the repository at this point in the history
The decorator/metadata system was updated and that necessitated changes
in the way that custom metadata locators were registered. This fix
updates the internals of the atscript support to this new api. Note
that this is a temporary change. AtScript will be going away, but we
didn’t want to remove it just yet in order to provide our customers
will time to deal with these external changes.
  • Loading branch information
EisenbergEffect committed Mar 31, 2015
1 parent 10cc026 commit 4b09490
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,16 @@ export class Plugins {
*/
atscript(){
this.aurelia.container.supportAtScript();
Metadata.configure.locator(fn => fn['annotate'] || fn['annotations']);
Metadata.configure.locator((fn, meta) => {
var annotations = fn['annotate'] || fn['annotations'],
i, ii;

if(annotations && annotations.length){
for(i = 0, ii = annotations.length; i < ii; ++i){
meta.add(annotations[i]);
}
}
});
return this;
}

Expand Down

0 comments on commit 4b09490

Please sign in to comment.