First install this plugin with npm:
npm install systemjs-plugin-dojo
Then add map to the loader:
SystemJS.config({
map: {
'dojo-loader': 'node_modules/systemjs-plugin-dojo/dojo.js'
}
});
First make sure dojo or esri works through dojoConfig
, for example:
(function (global) {
'use strict';
global.dojoConfig = {
async: true,
baseUrl: '.',
packages: [
{ name: 'dgrid', location: 'bower_components/dgrid' },
{ name: 'dijit', location: 'bower_components/dijit' },
{ name: 'dojo', location: 'bower_components/dojo' },
{ name: 'dojox', location: 'bower_components/dojox' },
{ name: 'dstore', location: 'bower_components/dstore' },
{ name: 'moment', location: 'bower_components/moment' },
{ name: 'esri', location: 'bower_components/esri' }
]
};
})(window);
And link dojo in your html file:
<script src="dojoConfig.js"></script>
<script src="bower_components/dojo/dojo.js"></script>
Then config all dojo related package load with the loader, for example:
SystemJS.config({
meta: {
'dojo/*': { loader: 'dojo-loader' },
'esri/*': { loader: 'dojo-loader' }
}
});
See ng2-esri-demo for more details.