2017-07-11 18:51:01 +02:00
|
|
|
// vim: set tw=80 ts=2 sw=2 sts=2:
|
|
|
|
import 'zone.js';
|
|
|
|
import 'reflect-metadata';
|
|
|
|
|
|
|
|
import './app.ts';
|
|
|
|
|
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
import { BrowserModule } from '@angular/platform-browser';
|
|
|
|
import { UpgradeModule } from '@angular/upgrade/static';
|
|
|
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
|
|
|
2017-07-16 10:37:52 +02:00
|
|
|
import { RestangularModule } from 'ngx-restangular';
|
|
|
|
|
2017-07-14 10:19:39 +02:00
|
|
|
import { AccountModule } from './accounts/account.module';
|
2017-07-16 10:37:52 +02:00
|
|
|
import { ApiBaseURL } from './app.config';
|
2017-07-14 10:19:39 +02:00
|
|
|
|
2017-07-11 18:51:01 +02:00
|
|
|
@NgModule({
|
|
|
|
imports: [
|
2017-07-16 10:30:53 +02:00
|
|
|
BrowserModule,
|
|
|
|
UpgradeModule,
|
2017-07-16 10:37:52 +02:00
|
|
|
AccountModule,
|
|
|
|
RestangularModule.forRoot((RestangularProvider) => {
|
|
|
|
RestangularProvider.setBaseUrl(ApiBaseURL);
|
|
|
|
|
|
|
|
// Inject JSON in error instead the full response object.
|
|
|
|
RestangularProvider.setErrorInterceptor(
|
|
|
|
function(response, subject, responseHandler) {
|
|
|
|
// TODO Alexis Lahouze 2017-07-16 Handle 401 error.
|
|
|
|
subject.error(response.json());
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
})
|
2017-07-16 10:30:53 +02:00
|
|
|
]
|
2017-07-11 18:51:01 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
export class AppModule {
|
|
|
|
constructor(private upgrade: UpgradeModule) { }
|
|
|
|
|
|
|
|
ngDoBootstrap() {
|
|
|
|
this.upgrade.bootstrap(document.body, ['accountant'], { strictDi: false });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
platformBrowserDynamic().bootstrapModule(AppModule);
|