This repository was archived by the owner on Feb 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathbootstrap.ts
81 lines (67 loc) · 1.72 KB
/
bootstrap.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/// <reference path="../typings/_custom.d.ts" />
// Angular 2
import {bootstrap} from 'angular2/angular2';
/*
* Common Injectables
* our custom helper injectables to configure our app differently using the dependency injection system
*/
// import {
// JIT_CHANGEDETECTION_BINDINGS,
// DYNAMIC_CHANGEDETECTION_BINDINGS,
// PREGENERATED_CHANGEDETECTION_BINDINGS,
// BEST_CHANGEDETECTION_BINDINGS
// } from '../common/change_detection_bindings';
// import {
// HTML5_LOCATION_BINDINGS,
// HASH_LOCATION_BINDINGS
// } from '../common/location_bindings';
/*
* Angular Modules
*/
import {FORM_PROVIDERS} from 'angular2/angular2';
import {HTTP_PROVIDERS} from 'angular2/http';
import {ROUTER_PROVIDERS} from 'angular2/router';
/*
* App Services
* our collection of injectables services
*/
import {APP_SERVICES_BINDINGS} from './services/services';
/*
* App Component
* our top level component that holds all of our components
*/
import {App} from './components/app';
/*
* Universal injectables
*/
const UNIVERSAL_BINDINGS = [
// Angular's http/form/router services/bindings
HTTP_PROVIDERS,
FORM_PROVIDERS,
ROUTER_PROVIDERS,
// Our collection of services from /services
APP_SERVICES_BINDINGS
];
/*
* Platform injectables
*/
const PLATFORM_BINDINGS = [
// if we want to explicit change detection
// BEST_CHANGEDETECTION_BINDINGS,
// if we want to use hashBash url for the router
// HASH_LOCATION_BINDINGS
];
const APP_BINDINGS = [
UNIVERSAL_BINDINGS,
PLATFORM_BINDINGS
];
/*
* Bootstrap our Angular app with a top level component `App` and inject
* our Universal/Platform services/bindings into Angular's dependency injection
*/
bootstrap(
// Top Level Component
App,
// AppBindings
APP_BINDINGS
);