|
2 | 2 | * System configuration for Angular 2 samples
|
3 | 3 | * Adjust as necessary for your application needs.
|
4 | 4 | */
|
5 |
| -(function(global) { |
| 5 | +(function (global) { |
| 6 | + System.config({ |
| 7 | + paths: { |
| 8 | + // paths serve as alias |
| 9 | + 'npm:': 'node_modules/' |
| 10 | + }, |
| 11 | + // map tells the System loader where to look for things |
| 12 | + map: { |
| 13 | + // our app is within the app folder |
| 14 | + app: 'app', |
6 | 15 |
|
7 |
| - // map tells the System loader where to look for things |
8 |
| - var map = { |
9 |
| - 'app': 'app', |
10 |
| - '@angular': 'node_modules/@angular', |
11 |
| - 'rxjs': 'node_modules/rxjs' |
12 |
| - }; |
13 |
| - |
14 |
| - // packages tells the System loader how to load when no filename and/or no extension |
15 |
| - var packages = { |
16 |
| - 'app': { main: 'main.js', defaultExtension: 'js' }, |
17 |
| - 'rxjs': { defaultExtension: 'js' } |
18 |
| - }; |
19 |
| - |
20 |
| - var packageNames = [ |
21 |
| - '@angular/common', |
22 |
| - '@angular/compiler', |
23 |
| - '@angular/core', |
24 |
| - '@angular/forms', |
25 |
| - '@angular/http', |
26 |
| - '@angular/platform-browser', |
27 |
| - '@angular/platform-browser-dynamic', |
28 |
| - '@angular/router' |
29 |
| - ]; |
| 16 | + // angular bundles |
| 17 | + '@angular/core': 'npm:@angular/core/bundles/core.umd.js', |
| 18 | + '@angular/common': 'npm:@angular/common/bundles/common.umd.js', |
| 19 | + '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', |
| 20 | + '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', |
| 21 | + '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', |
| 22 | + '@angular/http': 'npm:@angular/http/bundles/http.umd.js', |
| 23 | + '@angular/router': 'npm:@angular/router/bundles/router.umd.js', |
| 24 | + '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', |
30 | 25 |
|
31 |
| - // add package entries for angular packages in the form |
32 |
| - // '@angular/common': { main: 'index.js', defaultExtension: 'js' } |
33 |
| - packageNames.forEach(function(pkgName) { |
34 |
| - packages[pkgName] = { main: 'index.js', defaultExtension: 'js' }; |
| 26 | + // other libraries |
| 27 | + 'rxjs': 'npm:rxjs' |
| 28 | + }, |
| 29 | + // packages tells the System loader how to load when no filename and/or no extension |
| 30 | + packages: { |
| 31 | + app: { |
| 32 | + main: './main.js', |
| 33 | + defaultExtension: 'js' |
| 34 | + }, |
| 35 | + rxjs: { |
| 36 | + defaultExtension: 'js' |
| 37 | + } |
| 38 | + } |
35 | 39 | });
|
36 | 40 |
|
37 | 41 | var config = {
|
|
0 commit comments