| 
									
										
										
										
											2016-08-09 17:38:25 +01:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2016-11-04 21:59:51 -07:00
										 |  |  |  * WEB VERSION FOR CURRENT ANGULAR BUILD | 
					
						
							| 
									
										
										
										
											2016-08-09 17:38:25 +01:00
										 |  |  |  * (based on systemjs.config.js in angular.io) | 
					
						
							| 
									
										
										
										
											2016-09-20 05:24:40 +02:00
										 |  |  |  * System configuration for Angular samples | 
					
						
							| 
									
										
										
										
											2016-08-09 17:38:25 +01:00
										 |  |  |  * Adjust as necessary for your application needs. | 
					
						
							| 
									
										
										
										
											2016-08-31 23:56:12 -07:00
										 |  |  |  * | 
					
						
							|  |  |  |  * UNTESTED ! | 
					
						
							| 
									
										
										
										
											2016-08-09 17:38:25 +01:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2016-08-31 23:56:12 -07:00
										 |  |  | (function (global) { | 
					
						
							|  |  |  |   System.config({ | 
					
						
							| 
									
										
										
										
											2016-08-09 17:38:25 +01:00
										 |  |  |     // DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER
 | 
					
						
							|  |  |  |     transpiler: 'ts', | 
					
						
							|  |  |  |     typescriptOptions: { | 
					
						
							| 
									
										
										
										
											2016-11-18 11:31:32 -08:00
										 |  |  |       // Copy of compiler options in standard tsconfig.json
 | 
					
						
							| 
									
										
										
										
											2016-11-04 21:59:51 -07:00
										 |  |  |       "target": "es5", | 
					
						
							|  |  |  |       "module": "commonjs", | 
					
						
							|  |  |  |       "moduleResolution": "node", | 
					
						
							|  |  |  |       "sourceMap": true, | 
					
						
							|  |  |  |       "emitDecoratorMetadata": true, | 
					
						
							|  |  |  |       "experimentalDecorators": true, | 
					
						
							| 
									
										
										
										
											2016-12-13 20:57:47 -08:00
										 |  |  |       "lib": ["es2015", "dom"], | 
					
						
							| 
									
										
										
										
											2016-11-04 21:59:51 -07:00
										 |  |  |       "noImplicitAny": true, | 
					
						
							| 
									
										
										
										
											2016-11-18 11:31:32 -08:00
										 |  |  |       "suppressImplicitAnyIndexErrors": true | 
					
						
							| 
									
										
										
										
											2016-08-09 17:38:25 +01:00
										 |  |  |     }, | 
					
						
							|  |  |  |     meta: { | 
					
						
							|  |  |  |       'typescript': { | 
					
						
							|  |  |  |         "exports": "ts" | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2016-08-31 23:56:12 -07:00
										 |  |  |     paths: { | 
					
						
							|  |  |  |       // paths serve as alias
 | 
					
						
							|  |  |  |       'npm:': 'https://unpkg.com/', | 
					
						
							|  |  |  |       'ng:': 'https://cdn.rawgit.com/angular/' | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     // map tells the System loader where to look for things
 | 
					
						
							|  |  |  |     map: { | 
					
						
							|  |  |  |       // our app is within the app folder
 | 
					
						
							|  |  |  |       app: 'app', | 
					
						
							| 
									
										
										
										
											2016-08-09 17:38:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-31 23:56:12 -07:00
										 |  |  |       // angular bundles
 | 
					
						
							|  |  |  |       '@angular/core': 'ng:core-builds/master/bundles/core.umd.js', | 
					
						
							|  |  |  |       '@angular/common': 'ng:common-builds/master/bundles/common.umd.js', | 
					
						
							|  |  |  |       '@angular/compiler': 'ng:compiler-builds/master/bundles/compiler.umd.js', | 
					
						
							|  |  |  |       '@angular/platform-browser': 'ng:platform-browser-builds/master/bundles/platform-browser.umd.js', | 
					
						
							|  |  |  |       '@angular/platform-browser-dynamic': 'ng:platform-browser-dynamic-builds/master/bundles/platform-browser-dynamic.umd.js', | 
					
						
							|  |  |  |       '@angular/http': 'ng:http-builds/master/bundles/http.umd.js', | 
					
						
							|  |  |  |       '@angular/router': 'ng:router-builds/master/bundles/router.umd.js', | 
					
						
							| 
									
										
										
										
											2016-11-19 06:28:24 +00:00
										 |  |  |       '@angular/router/upgrade': 'ng:router-builds/master/bundles/router-upgrade.umd.js', | 
					
						
							| 
									
										
										
										
											2016-08-31 23:56:12 -07:00
										 |  |  |       '@angular/forms': 'ng:forms-builds/master/bundles/forms.umd.js', | 
					
						
							| 
									
										
										
										
											2016-09-14 00:56:35 +02:00
										 |  |  |       '@angular/upgrade': 'ng:upgrade-builds/master/bundles/upgrade.umd.js', | 
					
						
							| 
									
										
										
										
											2016-11-19 06:28:24 +00:00
										 |  |  |       '@angular/upgrade/static': 'ng:upgrade-builds/master/bundles/upgrade-static.umd.js', | 
					
						
							| 
									
										
										
										
											2016-08-09 17:38:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-02 01:11:27 -07:00
										 |  |  |       // angular testing umd bundles (overwrite the shim mappings)
 | 
					
						
							| 
									
										
										
										
											2016-08-31 23:56:12 -07:00
										 |  |  |       '@angular/core/testing': 'ng:core-builds/master/bundles/core-testing.umd.js', | 
					
						
							|  |  |  |       '@angular/common/testing': 'ng:common-builds/master/bundles/common-testing.umd.js', | 
					
						
							|  |  |  |       '@angular/compiler/testing': 'ng:compiler-builds/master/bundles/compiler-testing.umd.js', | 
					
						
							|  |  |  |       '@angular/platform-browser/testing': 'ng:platform-browser-builds/master/bundles/platform-browser-testing.umd.js', | 
					
						
							|  |  |  |       '@angular/platform-browser-dynamic/testing': 'ng:platform-browser-dynamic-builds/master/bundles/platform-browser-dynamic-testing.umd.js', | 
					
						
							|  |  |  |       '@angular/http/testing': 'ng:http-builds/master/bundles/http-testing.umd.js', | 
					
						
							|  |  |  |       '@angular/router/testing': 'ng:router-builds/master/bundles/router-testing.umd.js', | 
					
						
							|  |  |  |       '@angular/forms/testing': 'ng:forms-builds/master/bundles/forms-testing.umd.js', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       // other libraries
 | 
					
						
							| 
									
										
										
										
											2016-12-08 00:10:39 +00:00
										 |  |  |       'rxjs':                      'npm:rxjs@5.0.0-rc.4', | 
					
						
							| 
									
										
										
										
											2016-10-20 00:52:32 -04:00
										 |  |  |       'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js', | 
					
						
							| 
									
										
										
										
											2016-11-29 15:39:53 -08:00
										 |  |  |       'ts':                        'npm:plugin-typescript@5.2.7/lib/plugin.js', | 
					
						
							|  |  |  |       'typescript':                'npm:typescript@2.0.10/lib/typescript.js', | 
					
						
							| 
									
										
										
										
											2016-08-31 23:56:12 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     // packages tells the System loader how to load when no filename and/or no extension
 | 
					
						
							|  |  |  |     packages: { | 
					
						
							|  |  |  |       app: { | 
					
						
							|  |  |  |         main: './main.ts', | 
					
						
							|  |  |  |         defaultExtension: 'ts' | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       rxjs: { | 
					
						
							|  |  |  |         defaultExtension: 'js' | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2016-11-04 21:59:51 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-18 20:29:05 -08:00
										 |  |  |   if (global.autoBootstrap) { bootstrap(); } | 
					
						
							| 
									
										
										
										
											2016-11-04 21:59:51 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-18 20:29:05 -08:00
										 |  |  |   // Bootstrap with a default `AppModule`
 | 
					
						
							|  |  |  |   // ignore an `app/app.module.ts` and `app/main.ts`, even if present
 | 
					
						
							|  |  |  |   // This function exists primarily (exclusively?) for the QuickStart
 | 
					
						
							| 
									
										
										
										
											2016-11-04 21:59:51 -07:00
										 |  |  |   function bootstrap() { | 
					
						
							| 
									
										
										
										
											2016-11-18 11:31:32 -08:00
										 |  |  |     console.log('Auto-bootstrapping'); | 
					
						
							| 
									
										
										
										
											2016-11-04 21:59:51 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // Stub out `app/main.ts` so System.import('app') doesn't fail if called in the index.html
 | 
					
						
							|  |  |  |     System.set(System.normalizeSync('app/main.ts'), System.newModule({ })); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // bootstrap and launch the app (equivalent to standard main.ts)
 | 
					
						
							|  |  |  |     Promise.all([ | 
					
						
							|  |  |  |       System.import('@angular/platform-browser-dynamic'), | 
					
						
							| 
									
										
										
										
											2016-11-18 11:31:32 -08:00
										 |  |  |       getAppModule() | 
					
						
							| 
									
										
										
										
											2016-11-04 21:59:51 -07:00
										 |  |  |     ]) | 
					
						
							|  |  |  |     .then(function (imports) { | 
					
						
							|  |  |  |       var platform = imports[0]; | 
					
						
							|  |  |  |       var app      = imports[1]; | 
					
						
							|  |  |  |       platform.platformBrowserDynamic().bootstrapModule(app.AppModule); | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |     .catch(function(err){ console.error(err); }); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-18 20:29:05 -08:00
										 |  |  |   // Make the default AppModule
 | 
					
						
							| 
									
										
										
										
											2016-11-18 11:31:32 -08:00
										 |  |  |   // returns a promise for the AppModule
 | 
					
						
							|  |  |  |   function getAppModule() { | 
					
						
							| 
									
										
										
										
											2016-11-18 20:29:05 -08:00
										 |  |  |     console.log('Making a bare-bones, default AppModule'); | 
					
						
							| 
									
										
										
										
											2016-11-18 11:31:32 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     return Promise.all([ | 
					
						
							|  |  |  |       System.import('@angular/core'), | 
					
						
							|  |  |  |       System.import('@angular/platform-browser'), | 
					
						
							|  |  |  |       System.import('app/app.component') | 
					
						
							|  |  |  |     ]) | 
					
						
							|  |  |  |     .then(function (imports) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       var core    = imports[0]; | 
					
						
							|  |  |  |       var browser = imports[1]; | 
					
						
							|  |  |  |       var appComp = imports[2].AppComponent; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       var AppModule = function() {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       AppModule.annotations = [ | 
					
						
							|  |  |  |         new core.NgModule({ | 
					
						
							|  |  |  |           imports:      [ browser.BrowserModule ], | 
					
						
							|  |  |  |           declarations: [ appComp ], | 
					
						
							|  |  |  |           bootstrap:    [ appComp ] | 
					
						
							|  |  |  |         }) | 
					
						
							|  |  |  |       ] | 
					
						
							|  |  |  |       return {AppModule: AppModule}; | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2016-08-09 17:38:25 +01:00
										 |  |  | })(this); | 
					
						
							| 
									
										
										
										
											2016-11-18 20:29:05 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* | 
					
						
							|  |  |  | Copyright 2016 Google Inc. All Rights Reserved. | 
					
						
							|  |  |  | Use of this source code is governed by an MIT-style license that | 
					
						
							|  |  |  | can be found in the LICENSE file at http://angular.io/license
 | 
					
						
							|  |  |  | */ |