Reputation: 2329
I am taking baby steps learning angularjs from video tutorial and as i reached the controllers section i had this error:
Argument 'SimpleController' is not a function, got undefined
although i followed the steps carefully.Please bare in mind that this is all i know about angularjs so far.
<!DOCTYPE html>
<html data-ng-app="">
<head></head>
<body>
<div data-ng-controller="SimpleController">
<input type="text" data-ng-model="name" id=""> {{ name }}
<br>
<h3>Looping with the ng-repeat Directive</h3>
<ul>
<li data-ng-repeat="cutomer in customers | filter:name | orderBy:'city'">{{ cutomer.name | uppercase }} - {{ cutomer.city | lowercase }}</li>
</ul>
</div>
<script src="angular.min.js"></script>
<script>
function SimpleController($scope) {
$scope.customers = [
{name:'Yasser Moussa',city:'Alexandria'},
{name:'Ahmed Salah',city:'Al Riyadh'},
{name:'Khaled Medhat',city:'Alexandria'},
{name:'Ali Dawood',city:'Cairo'}
];
}
</script>
</body>
</html>
Upvotes: 1
Views: 182