Advertisement
Kenya-West

Untitled

Aug 2nd, 2017
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.     /**
  3.      * WEB ANGULAR VERSION
  4.      * (based on systemjs.config.js in angular.io)
  5.      * System configuration for Angular samples
  6.      * Adjust as necessary for your application needs.
  7.      */
  8.     (function (global) {
  9.       System.config({
  10.         // DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER
  11.         transpiler: 'ts',
  12.         typescriptOptions: {
  13.           // Complete copy of compiler options in standard tsconfig.json
  14.           "emitDecoratorMetadata": true,
  15.           "experimentalDecorators": true,
  16.           "lib": ["es2015", "dom"],
  17.           "module": "commonjs",
  18.           "moduleResolution": "node",
  19.           "noImplicitAny": true,
  20.           "sourceMap": true,
  21.           "suppressImplicitAnyIndexErrors": true,
  22.           "target": "es5"
  23.         },
  24.         meta: {
  25.           'typescript': {
  26.             "exports": "ts"
  27.           }
  28.         },
  29.         paths: {
  30.           // paths serve as alias
  31.           'npm:': 'https://unpkg.com/',
  32.           'node_modules:': 'node_modules/'
  33.         },
  34.         // map tells the System loader where to look for things
  35.         map: {
  36.           // our app is within the app folder
  37.           app: 'app',
  38.           // angular bundles
  39.           '@angular/core': 'node_modules:@angular/core/bundles/core.umd.js',
  40.           '@angular/common': 'node_modules:@angular/common/bundles/common.umd.js',
  41.           '@angular/compiler': 'node_modules:@angular/compiler/bundles/compiler.umd.js',
  42.           '@angular/platform-browser': 'node_modules:@angular/platform-browser/bundles/platform-browser.umd.js',
  43.           '@angular/platform-browser-dynamic': 'node_modules:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
  44.           '@angular/http': 'node_modules:@angular/http/bundles/http.umd.js',
  45.           '@angular/router': 'node_modules:@angular/router/bundles/router.umd.js',
  46.           '@angular/forms': 'node_modules:@angular/forms/bundles/forms.umd.js',
  47.           '@angular/animations': 'node_modules:@angular/animations/bundles/animations.umd.js',
  48.           '@angular/animations/browser': 'node_modules:@angular/animations/bundles/animations-browser.umd.js',
  49.           '@angular/platform-browser/animations': 'node_modules:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
  50.           // other libraries
  51.           'rxjs': 'node_modules:rxjs',
  52.           'ts': 'node_modules:plugin-typescript/lib/plugin.js',
  53.           'typescript': 'node_modules:typescript/lib/typescript.js',
  54.         },
  55.         // packages tells the System loader how to load when no filename and/or no extension
  56.         packages: {
  57.           app: {
  58.             main: './main.ts',
  59.             defaultExtension: 'ts'
  60.           },
  61.           rxjs: {
  62.             defaultExtension: 'js'
  63.           }
  64.         }
  65.       });
  66.       if (!global.noBootstrap) {
  67.         bootstrap();
  68.       }
  69.       // Bootstrap the `AppModule`(skip the `app/main.ts` that normally does this)
  70.       function bootstrap() {
  71.         // Stub out `app/main.ts` so System.import('app') doesn't fail if called in the index.html
  72.         System.set(System.normalizeSync('app/main.ts'), System.newModule({}));
  73.         // bootstrap and launch the app (equivalent to standard main.ts)
  74.         Promise.all([
  75.             System.import('@angular/platform-browser-dynamic'),
  76.             System.import('app/app.module')
  77.           ])
  78.           .then(function (imports) {
  79.             var platform = imports[0];
  80.             var app = imports[1];
  81.             platform.platformBrowserDynamic().bootstrapModule(app.AppModule);
  82.           })
  83.           .catch(function (err) {
  84.             console.error(err);
  85.           });
  86.       }
  87.     })(this);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement