Skip to content

Commit 2a544e0

Browse files
committed
(#3) Bootstraps the entire app
1 parent 8c3fe06 commit 2a544e0

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

src/app/bootstrap.ts

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/// <reference path="../typings/_custom.d.ts" />
2+
3+
// Angular 2
4+
import {bootstrap} from 'angular2/angular2';
5+
6+
7+
/*
8+
* Common Injectables
9+
* our custom helper injectables to configure our app differently using the dependency injection system
10+
*/
11+
import {
12+
jitInjectables,
13+
dynamicInjectables,
14+
preGeneratedInjectables
15+
} from '../common/changeDetectionInjectables';
16+
import {
17+
html5locationInjectables,
18+
hashlocationInjectables
19+
} from '../common/locationInjectables';
20+
21+
/*
22+
* Angular Modules
23+
*/
24+
import {httpInjectables, formInjectables} from 'angular2/angular2';
25+
import {routerInjectables} from 'angular2/router';
26+
27+
/*
28+
* App Services
29+
* our collection of injectables services
30+
*/
31+
import {appServicesInjectables} from './services/services';
32+
33+
34+
/*
35+
* App Component
36+
* our top level component that holds all of our components
37+
*/
38+
import {App} from './components/app';
39+
40+
41+
/*
42+
* Universal injectables
43+
*/
44+
var universalInjectables = [
45+
// Angular's http/form/router services/bindings
46+
httpInjectables,
47+
formInjectables,
48+
routerInjectables,
49+
50+
// Our collection of services from /services
51+
appServicesInjectables
52+
];
53+
54+
/*
55+
* Platform injectables
56+
*/
57+
var platformInjectables = [
58+
// if we want to use the Just-In-Time change detection
59+
// bestChangeDetectionInjectables,
60+
61+
// if we want to use hashBash url for the router
62+
// hashlocationInjectables
63+
];
64+
65+
/*
66+
* Bootstrap our Angular app with a top level component `App` and inject
67+
* our Universal/Platform services/bindings into Angular's dependency injection
68+
*/
69+
bootstrap(
70+
// Top Level Component
71+
App,
72+
73+
// AppInjector
74+
[
75+
universalInjectables,
76+
platformInjectables
77+
]
78+
);

0 commit comments

Comments
 (0)