Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 1 | //import './app/app.ts'; |
| 2 | import {ng1appModule} from './app/app'; |
| 3 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; |
| 4 | import {enableProdMode} from '@angular/core'; |
| 5 | import {AppModule} from './app/ng2/app.module'; |
| 6 | import {UpgradeModule} from '@angular/upgrade/static'; |
| 7 | import {IAppConfigurtaion} from "./app/models/app-config"; |
| 8 | |
| 9 | declare var __ENV__: string; |
| 10 | export declare var sdc2Config: IAppConfigurtaion; |
| 11 | |
| 12 | if (__ENV__==='prod') { |
| 13 | sdc2Config = require('./../configurations/prod.js'); |
| 14 | enableProdMode(); |
| 15 | } else { |
| 16 | sdc2Config = require('./../configurations/dev.js'); |
| 17 | } |
| 18 | |
| 19 | // Ugliy fix because the cookie recieved from webseal change his value after some seconds. |
| 20 | declare var __ENV__: string; |
| 21 | let timeout:number = 5000; |
| 22 | if (__ENV__==='dev'){ |
| 23 | timeout=0; |
| 24 | } |
| 25 | window.setTimeout(()=>{ |
| 26 | platformBrowserDynamic().bootstrapModule(AppModule).then(platformRef => { |
| 27 | const upgrade = platformRef.injector.get(UpgradeModule) as UpgradeModule; |
| 28 | upgrade.bootstrap(document.body, [ng1appModule.name], {strictDi: true}); |
| 29 | }); |
| 30 | },timeout); |