@@ -86,6 +86,8 @@ export class Aurelia {
86
86
use:Plugins ;
87
87
88
88
constructor ( loader ? :Loader , container ? :Container , resources ? :ViewResources ) {
89
+ this . hostConfigured = false ;
90
+ this . host = null ;
89
91
this . resourcesToLoad = { } ;
90
92
this . preStartTasks = [ ] ;
91
93
this . postStartTasks = [ ] ;
@@ -278,8 +280,7 @@ export class Aurelia {
278
280
compositionEngine = this . container . get ( CompositionEngine ) ;
279
281
instruction . viewModel = root ;
280
282
instruction . container = instruction . childContainer = this . container ;
281
- instruction . viewSlot = new ViewSlot ( this . host , true ) ;
282
- instruction . viewSlot . transformChildNodesIntoView ( ) ;
283
+ instruction . viewSlot = this . hostSlot ;
283
284
instruction . host = this . host ;
284
285
285
286
return compositionEngine . compose ( instruction ) . then ( root => {
@@ -291,6 +292,10 @@ export class Aurelia {
291
292
}
292
293
293
294
_configureHost ( applicationHost ) {
295
+ if ( this . hostConfigured ) {
296
+ return ;
297
+ }
298
+
294
299
applicationHost = applicationHost || this . host ;
295
300
296
301
if ( ! applicationHost || typeof applicationHost == 'string' ) {
@@ -299,7 +304,10 @@ export class Aurelia {
299
304
this. host = applicationHost ;
300
305
}
301
306
307
+ this . hostConfigured = true ;
302
308
this . host . aurelia = this ;
309
+ this . hostSlot = new ViewSlot ( this . host , true ) ;
310
+ this . hostSlot . transformChildNodesIntoView ( ) ;
303
311
this . container . registerInstance ( DOMBoundary , this . host ) ;
304
312
}
305
313
0 commit comments