I am building and Angular2 application in a ASP.Net core project. I have systemJS configured to map third party modules but I am getting compile errors.
My index.html references the systemJS.config.js file and I think it's correct. However, index.html is a runtime file and I don't think the typescript compiler knows about it.
How does typescript know about systemjs (and it's config) at compile time?
One of the third party modules is ng2-file-upload.
systemjs.config.js has this:
var map = {
'app': 'lib/spa', // 'dist',
'rxjs': 'lib/js/rxjs',
'angular2-in-memory-web-api': 'lib/js/angular2-in-memory-web-api',
'@angular': 'lib/js/@angular',
'ng2-file-upload': 'lib/js/ng2-file-upload/ng2-file-upload'
};
var config = {
defaultJSExtensions: true,
map: map,
packages: packages
}
System.config(config);
This is referenced from index.html as:
<script>
System.import('app').catch(function(err){ console.error(err); });
</script>
In my component I use import like this:
import {FILE_UPLOAD_DIRECTIVES, FileUploader} from 'ng2-file-upload';
I get this compiler error:
error TS2307: Cannot find module 'ng2-file-upload'.
My thought is that typescript does not know about the ng2-file-upload alias setup in the map for systemJS. How does typescript know about this?