Search code examples
angularsystemjsjs-amdes6-module-loader

SystemJS and AngularJS 2


I am trying to load what I call the Core Angular2 module for my application. The module is being developed using Typescript. You can think of it as the same quick start tutorial on the Angular.IO site.

The change I am trying to make is to load my Module from 2 levels deeps. For example. The tutorial load the Main.js file from the root directory. I want to load the Main.js file from the directory /assets/js/core/Main.js

Thanks in advanced!


Solution

  • For your System.import do:

    System.import('assets/js/core/main') 
    

    Instead of the default you have there, that should do it. This tells SystemJS where the main app file is.