I am going through the step by step tutorial on angular.io (Angular 2). I am using typescript. I get the following error when trying to compile:
Cannot find external module 'angular2/angular2'
using the watch command.
main.ts
import {Component, View, bootstrap} from 'angular2/angular2';
@Component({
selector: 'my-app'
})
@View({
template: '<h1>My first Angular 2 App</h1>'
})
class AppComponent {
}
bootstrap(AppComponent);
index.html
<!DOCTYPE html>
<html>
<head>
<script src="https://jspm.io/[email protected]"></script>
<script src="https://code.angularjs.org/2.0.0-alpha.23/angular2.dev.js"></script>
</head>
<body>
<my-app></my-app>
<script>
System.import('main');
</script>
</body>
</html>
Q Why is this error occuring?
Adding these files to the head will give you the latest working version of Angular2.
Source: Angular.io: 5 Minute Quickstart