I am following the tutorial : AngularJS in 60 min and I am failed to get working a simple script where the controller is declared on the same page as the view (Indeed it is very basic). But actually it is not working properly:
So my code is :
<!DOCTYPE html>
<html data-ng-app="">
<head>
<title>AngularJS in 60 minutes</title>
<script src="./js/angular.min.js" charset="utf-8"></script>
</head>
<body>
<div class="container" data-ng-controller="SimpleController">
<h3>Instance of model and data binding</h3>
Name : <input type="text" data-ng-model="city"> {{ city }}
<h3>Instance of repeat directives</h3>
<ul>
<ol data-ng-repeat="person in people | filter:city | orderBy:'city'">{{ person.firstname}} {{ person.name | uppercase}} : {{ person.city}}</ol>
</ul>
</div>
<script>
function SimpleController($scope) {
$scope.people = [{firstname:'Valerie', name:'lion', city:'Paris'}, {firstname:'Fred', name:'creche', city:'Marly'}, {firstname:'Laurent', name:'larher', city:'Massy'}];
}
</script>
</body>
and the result is in the image enclosed.
Any suggestions is welcome.
Fred