-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ts
33 lines (28 loc) · 1.34 KB
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
///<reference path="../typings/index.d.ts"/>
import { bootstrap } from '@angular/platform-browser-dynamic';
import { PLATFORM_PIPES } from '@angular/core';
import { HTTP_PROVIDERS } from '@angular/http';
import { ViewResolver } from '@angular/compiler';
import { ViewResolverService } from './services/view-resolver.service';
import { PluginComponent } from './components/plugin.component';
import { PluginConfig, PluginOptions } from './services/plugin.config';
import { TranslationPipe } from './pipes/translation.pipe';
export function RunApplication(options: PluginOptions) {
// Create our API config provider using the external data
//
let menuConfig = new PluginConfig(options);
window && (window['__it7_networking_plugin__'] = menuConfig.templatesBaseUrl);
// Now we can call bootstrap, but we have the API config object
// set up as well. Just create is as an injectable token here
// so other components/services can consume it.
//
bootstrap(PluginComponent, [
HTTP_PROVIDERS,
{ provide: Window, useValue: window },
{ provide: PluginConfig, useValue: menuConfig },
{ provide: ViewResolver, useClass: ViewResolverService},
[{provide: PLATFORM_PIPES, useValue: [TranslationPipe], multi:true}]
]);
}
window['RunApplication'] = RunApplication;
//bootstrap(PluginComponent);