I'm trying angular 2 with TS and SystemJS.
I would like to map one of my folders in system.config.js.
|_ app
| |_ standalone
| | |_ rest.service.js
| | |_ rest.service.js.map
| | |_ rest.service.ts
| |_ app.module.ts
|_ node_modules
|_ system.config.js
This is a simplified version of what I have in system.config.js:
System.config({
paths: {
'npm:': 'node_modules/'
},
map: {
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'rxjs': 'npm:rxjs',
'stalone': 'app/standalone'
},
packages: {
app: {
main: './main.js',
defaultExtension: 'js'
},
stalone: {
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
}
}
});
})(this);
Two of my imports in app.module.ts are:
import { RestService } from "stalone/rest.service";
import { NgModule } from "@angular/core";
"@angular.core" does get imported without problems, but when importing "stalone/rest.service", I get the error:
Cannot find module 'stalone/rest.service'.
I've only included files, that I think are relevant in this matter. If I've missed any, please let me know.
import { RestService } from "./standalone/rest.service". SystemJS will be expecting a module.