Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * WEB ANGULAR VERSION
- * (based on systemjs.config.js in angular.io)
- * System configuration for Angular samples
- * Adjust as necessary for your application needs.
- */
- (function (global) {
- System.config({
- // DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER
- transpiler: 'ts',
- typescriptOptions: {
- // Complete copy of compiler options in standard tsconfig.json
- "emitDecoratorMetadata": true,
- "experimentalDecorators": true,
- "lib": ["es2015", "dom"],
- "module": "commonjs",
- "moduleResolution": "node",
- "noImplicitAny": true,
- "sourceMap": true,
- "suppressImplicitAnyIndexErrors": true,
- "target": "es5"
- },
- meta: {
- 'typescript': {
- "exports": "ts"
- }
- },
- paths: {
- // paths serve as alias
- 'npm:': 'https://unpkg.com/',
- 'node_modules:': 'node_modules/'
- },
- // map tells the System loader where to look for things
- map: {
- // our app is within the app folder
- app: 'app',
- // angular bundles
- '@angular/core': 'node_modules:@angular/core/bundles/core.umd.js',
- '@angular/common': 'node_modules:@angular/common/bundles/common.umd.js',
- '@angular/compiler': 'node_modules:@angular/compiler/bundles/compiler.umd.js',
- '@angular/platform-browser': 'node_modules:@angular/platform-browser/bundles/platform-browser.umd.js',
- '@angular/platform-browser-dynamic': 'node_modules:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
- '@angular/http': 'node_modules:@angular/http/bundles/http.umd.js',
- '@angular/router': 'node_modules:@angular/router/bundles/router.umd.js',
- '@angular/forms': 'node_modules:@angular/forms/bundles/forms.umd.js',
- '@angular/animations': 'node_modules:@angular/animations/bundles/animations.umd.js',
- '@angular/animations/browser': 'node_modules:@angular/animations/bundles/animations-browser.umd.js',
- '@angular/platform-browser/animations': 'node_modules:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
- // other libraries
- 'rxjs': 'node_modules:rxjs',
- 'ts': 'node_modules:plugin-typescript/lib/plugin.js',
- 'typescript': 'node_modules:typescript/lib/typescript.js',
- },
- // 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'
- }
- }
- });
- if (!global.noBootstrap) {
- bootstrap();
- }
- // Bootstrap the `AppModule`(skip the `app/main.ts` that normally does this)
- function bootstrap() {
- // 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'),
- System.import('app/app.module')
- ])
- .then(function (imports) {
- var platform = imports[0];
- var app = imports[1];
- platform.platformBrowserDynamic().bootstrapModule(app.AppModule);
- })
- .catch(function (err) {
- console.error(err);
- });
- }
- })(this);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement