Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

i18n cookbook using JIT: System is not defined error #3238

Open
MeMeMax opened this issue Feb 11, 2017 · 0 comments
Open

i18n cookbook using JIT: System is not defined error #3238

MeMeMax opened this issue Feb 11, 2017 · 0 comments

Comments

@MeMeMax
Copy link

MeMeMax commented Feb 11, 2017

Following the i18n cookbook i get System is not defined.
Im using latest Angular CLI.
The issue comes up in the <script> tag which has to be included to the index.html.

<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 <script> tag above is evaluated first and after that the dependencies from the angular-cli.json are loaded. So System is not defined.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant