@@ -5,6 +5,7 @@ import { ThyDialog } from 'ngx-tethys/dialog';
55import { ADetailComponent } from './a-detail/a-detail.component' ;
66import { ThyConfirmService , ThyNotifyService } from 'ngx-tethys' ;
77import { AppRootContext } from '@demo/common' ;
8+ import { CustomSettingsService } from './custom-settings.service' ;
89
910@Component ( {
1011 selector : 'app-root' ,
@@ -20,8 +21,7 @@ export class AppComponent implements OnInit {
2021 }
2122
2223 constructor (
23- private router : Router ,
24- private route : ActivatedRoute ,
24+ private customSettingsService : CustomSettingsService ,
2525 private planet : Planet ,
2626 private globalEventDispatcher : GlobalEventDispatcher ,
2727 private thyDialog : ThyDialog ,
@@ -43,18 +43,19 @@ export class AppComponent implements OnInit {
4343 appRootContext : this . appRootContext
4444 } ) ;
4545
46- const appHostContainerSelector = '#app-host-container' ;
47- const appHostContainerClass = 'thy-layout' ;
46+ const appHostClass = 'thy-layout' ;
4847
48+ const settings = this . customSettingsService . get ( ) ;
4949 this . planet . registerApps ( [
5050 {
5151 name : 'app1' ,
52- host : appHostContainerSelector ,
53- hostClass : appHostContainerClass ,
52+ hostParent : '#app-host-container' ,
53+ hostClass : appHostClass ,
5454 routerPathPrefix : / \/ a p p 1 | a p p 4 / , // '/app1',
5555 selector : 'app1-root-container' ,
5656 resourcePathPrefix : '/app1/static/' ,
57- preload : true ,
57+ preload : settings . app1 . preload ,
58+ switchMode : settings . app1 . switchMode ,
5859 loadSerial : true ,
5960 // prettier-ignore
6061 scripts : [
@@ -70,11 +71,12 @@ export class AppComponent implements OnInit {
7071 } ,
7172 {
7273 name : 'app2' ,
73- host : appHostContainerSelector ,
74- hostClass : appHostContainerClass ,
75- routerPathPrefix : '/app2' ,
74+ hostParent : '#app-host-container' ,
7675 selector : 'app2-root-container' ,
77- preload : true ,
76+ hostClass : appHostClass ,
77+ routerPathPrefix : '/app2' ,
78+ preload : settings . app2 . preload ,
79+ switchMode : settings . app2 . switchMode ,
7880 // prettier-ignore
7981 scripts : [
8082 '/app2/static/main.js'
0 commit comments