angular.io
angular.io copied to clipboard
i18n cookbook using JIT: System is not defined error
Following the i18n cookbook i get System is not defined. Im using latest Angular CLI. The issue comes up in the
<script>
// Get the locale id somehow
document.locale = 'es';
// Map to the text plugin
System.config({
map: {
text: 'systemjs-text-plugin.js'
}
});
// Launch the app
System.import('main.js').catch(function(err){ console.error(err); });
</script>
I loaded system.js as a dependency with npm install systemjs --save and included it to the scripts part in my angular-cli.json. But there is a timing issue as the