I am trying to add Angular2 to my current Angular 1.X projects. I am using yo angular project, with TypeScript enabled.
I installed everything (using npm install):
<script src="/node_modules/systemjs/dist/system.src.js"></script>
<script src="/node_modules/rxjs/bundles/Rx.js"></script>
<script src="/node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="/node_modules/angular2/bundles/http.dev.js"></script>
<script src="/node_modules/angular2/bundles/router.dev.js"></script>
And I added the following config:
<script>
System.config({
packages: {
app: {
format: 'cjs',
defaultExtension: 'js'
}
},
paths: {
'angular2/upgrade': '../node_modules/angular2/upgrade'
}
});
System.import('scripts/bootstrap.js').then(null, console.error.bind(console));
</script>
Now, inside my Bootstrap.ts I use:
import {UpgradeAdapter} from 'angular2/upgrade';
Typescript knows how to transpile it, into my .tmp:
var upgrade_1 = require('angular2/upgrade');
But SystemJS doesn't know how to load the import. I am getting 404 error:
GET http://localhost:9000/node_modules/angular2/upgrade 404 (Not Found)
My directory structure:
root
- .tmp
- node_modules
- app
|-- index.html
|-- scripts
What am I missing here?