1

I wanted to play with Angular2 - a very unsophisticated start! I didn't more than copy some code from angular.io to my files. In LightTable (integrated browser this code does not work:

<!DOCTYPE html>
<html>
  <head>
    <title>Angular2 TestApp</title>
    <script type="text/javascript" src="./libs/angular2.sfx.dev.js"></script>
    <script type="text/javascript" src="./src/main.js"></script>
  </head>
  <body>
    <my-app></my-app>
  </body>
</html>

JavaScript of main.js:

function AppComponent() {}

AppComponent.annotations = [
   new angular.ComponentAnnotation({
    selector: 'my-app'
  }),
  new angular.ViewAnnotation({
    template: '<h1>My first Angular 2 App</h1>'
  })
];

document.addEventListener('DOMContentLoaded', function() {
  document.body.innerHTML += 'Hi'; //for checking, whether the file is      recognized
  angular.bootstrap(AppComponent);
});

Now in LightTable (Browser) I get the following error messages:

Uncaught Error: ModuleEvaluationError: undefined is not a function in traceur-runtime@0.0.88/src/runtime/async.js
  angular2.sfx.dev.js [2331]    UncoatedModuleInstantiator.getUncoatedModule
  angular2.sfx.dev.js [2413]    ModuleStore.get
  angular2.sfx.dev.js [3187]    anonymous
Uncaught ReferenceError: angular is not defined
  main.js [5]   anonymous

But in the current Firefox it works fine. What am I doing wrong? Thank you very much!

BairDev
  • 2,865
  • 4
  • 27
  • 50

1 Answers1

0

This particular case was/is an issue in LightTable, it should be fixed with 0.8.x. In this thread are more informations and an example project.

BairDev
  • 2,865
  • 4
  • 27
  • 50