Frank Tudor
Frank Tudor

Reputation: 4504

simple angularjs 2.0 example using typescript

Be a dear, and help me with this simple Angularjs 2.0 example using typescript.

What have I tried?

I will provide my index.html and plunker the rest (I am sure there are more than a few issues in the plunker link below), I am just starting AngularJS 2.0 + typescript.

<html>
  <head>
    <title>Angular 2 Todo</title>
    <script src="https://code.angularjs.org/tools/system.js"></script>
    <script src="https://code.angularjs.org/tools/typescript.js"></script>
    <script src="https://code.angularjs.org/2.0.0-beta.9/angular2.min.js"></script>
    <script>
    System.config({
        transpiler: 'typescript',
        typescriptOptions: {emitDecoratorMetadata: true},
        packages: {app: {defaultExtension: 'ts'}}
    });
    System.import('app');
    </script>
  </head>
  <body>
    <app>Loading</app>
  </body>
</html>

Plunker Link

Upvotes: 0

Views: 331

Answers (1)

eko
eko

Reputation: 40647

You are using <script src="https://code.angularjs.org/2.0.0-beta.9/angular2.min.js"></script>

but importing your directives with rc syntax'@angular/common';

Here's a simple plunker with rc.1 for a start: Plunker

Upvotes: 2

Related Questions