I am going over a tutorial on Angular JS, I have gone over the code several times and its exactly as the person types but get {{name}}
and {{age}}
in the browser.
Can anyone tell me what I am doing wrong?
Another question that I have is that in one tutorial his html document has got the head
and body
tags in another its just the doctype, a link to angular and then he starts typing his code.
If this is a style, which one should I follow, shall i leave the body tag on or remove them?
<!doctype html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
</head>
<body>
<div ng-controller="Ctrl">
<input ng-model="name">
<h1>{{name}}</h1>
<h2>{{age}}</h2>
</div>
<script>
var Ctrl = function($scope) {
$scope.name = "James";
$scope.age = "20";
}
</script>
</body>