Permalink
Browse files

fix(view-engine): singleton instance of auSlotBehavior

  • Loading branch information...
EisenbergEffect committed Oct 14, 2017
1 parent c53f5cf commit c08db20c345fac62921ff9ff0c0e601388695999
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/view-engine.js
View
@@ -47,6 +47,8 @@ class ProxyViewFactory {
}
}
let auSlotBehavior = null;
/**
* Controls the view resource loading pipeline.
*/
@@ -73,9 +75,12 @@ export class ViewEngine {
this.appResources = appResources;
this._pluginMap = {};
let auSlotBehavior = new HtmlBehaviorResource();
auSlotBehavior.attributeName = 'au-slot';
metadata.define(metadata.resource, auSlotBehavior, SlotCustomAttribute);
if (auSlotBehavior === null) {
auSlotBehavior = new HtmlBehaviorResource();
auSlotBehavior.attributeName = 'au-slot';
metadata.define(metadata.resource, auSlotBehavior, SlotCustomAttribute);
}
auSlotBehavior.initialize(container, SlotCustomAttribute);
auSlotBehavior.register(appResources);
}

0 comments on commit c08db20

Please sign in to comment.