Skip to content Skip to sidebar Skip to footer

Angular2: SyntaxError: Unexpected Token <(…)

I know, this question was asked already, but I can't find the solution for my particular case I can't not understand real reason of the error. I have an angularjs2 app which is run

Solution 1:

You need to add this in your SystemJS configuration instead of including it into a script element:

<script>
  System.config({
    transpiler: 'typescript',
    typescriptOptions: { emitDecoratorMetadata: true },
    map: {
      marked: 'node_modules/marked/marked.min.js'
    },
    packages: {'app': {defaultExtension: 'ts'}}
  });
</script>

See this plunkr: https://plnkr.co/edit/0oSeaIyMWoq5fAKKlJLA?p=preview.

This question could be useful for you:


Post a Comment for "Angular2: SyntaxError: Unexpected Token <(…)"