I'm trying to run a basic Angular2 app. However currently running into the following error when I run the app with live-server
and npm start
:
Uncaught ReferenceError: ng is not defined
I have the latest Angular2 npm installed. Here is my markup:
<html>
<head>
<title></title>
<script src="https://rawgithub.com/systemjs/systemjs/0.19.6/dist/system.js"></script>
<script src="https://code.angularjs.org/tools/typescript.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.0/angular2-polyfills.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.0/Rx.js"></script>
<script src="https://code.angularjs.org/2.0.0-beta.0/angular2.dev.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="app.js"></script>
</head>
<body>
<first-comp></first-comp>
</body>
</html>
My app.js file:
var FirstComponent = ng.
Component({
selector: 'first-comp'
})
.View({
template: '<h2>I am learning {{ myFramework }}</h2>'
})
.Class({
constructor: function() {
this.myFramework = "Angular2";
}
});
document.addEventListener('DOMContentLoaded', function() {
ng.bootstrap(firstComponent);
});