I am attempting to set up ASP.NET MVC 5 (not Core) with Angular 2.0.0 using JSPM, SystemJS, and TS Loader.
It seems like there might be an issue with the TS loader in my opinion. Any recommendations?
When I try to run the app, I encounter this error:
Error: (SystemJS) core_1.provide is not a function
TypeError: core_1.provide is not a function
at execute (http://localhost:59711/app/bootstrap.ts!transpiled:26:24)
Error loading http://localhost:59711/app/bootstrap.ts
Below are my configuration files:
tsconfig.json
{
"compilerOptions": {
"target": "es5",
/* target of the compilation (es5) */
"module": "system",
/* System.register([dependencies], function) (in JS)*/
"moduleResolution": "node",
/* how module gets resolved (needed for Angular 2)*/
"emitDecoratorMetadata": true,
/* needed for decorators */
"experimentalDecorators": true,
/* needed for decorators (@Injectable) */
"noImplicitAny": false
/* any has to be written explicity*/
},
"exclude": [
/* since compiling these packages could take ages, we want to ignore them*/
"jspm_packages",
"node_modules"
],
"compileOnSave": false
/* on default the compiler will create js files */
}
config.js (JSPM configuration, simplified files)
System.config({
baseURL: "/",
defaultJSExtensions: true,
transpiler: "babel",
babelOptions: {
"optional": [
"runtime",
"optimisation.modules.system"
]
},
typescriptOptions: {
"tsconfig": true
},
paths: {
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*"
},
// Other configurations...
});
index.html
<script src = "../../jspm_packages/npm/..."/Reflect.js"></script>
<script src = "../../jspm_packages/system.js"></script>
<script src = "../../config.js"></script>
// Other script tags...
bootstrap.ts
// Bootstrap code here