I'm new to AngularJS. I've following egghead.io I've set up a controller and model to retrieve message from input component and display it. I'm using ui-router.
Here's my index.html
<!DOCTYPE html>
<html ng-app="app">
<head lang="en">
<meta charset="UTF-8">
<title> </title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.js"></script>
<script src="//angular-ui.github.io/ui-router/release/angular-ui-router.js"></script>
<script src="app.js"></script>
</head>
<body>
<div ui-view=""></div>
</body>
</html>
Here's my app.js
angular.module('app',["ui.router"])
.config([function($stateProvider) {
$stateProvider
.state('index', {
url:"",
templateUrl:"templates/first.html",
controller:"FirstCtr as first"
});
});
.controller("FirstCtr", function FirstCtr() {
var first = this;
first.greeting = "First";
});
Here's my templates/first.html
<input type="text" ng-model="first.greeting"/>
<div ng-class="first.greeting">
{{first.greeting}} {{"World"}}
</div>
After I go to http://localhost:8080, it was blank and throw this error
Please give me some suggestions.
