This is my first attempt with Angular. I am trying to run existing code from Internet and it gives error:
Error: error:areq Bad Argument
Argument 'ngAddressListController' is not a function, got undefined
This code works well with AngularJS < 1.3 but it's giving problem in 1.3+
Code is given below:
HTML
<!doctype html>
<html ng-app="">
<head>
<title>Ng Addressbook</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.1/angular.min.js"></script>
<script src="main.js"> </script>
</head>
<body>
<div ng-controller="ngAddressListController">
<h3>Ng Address Book</h3>
<div id="container">
<h3>There are 4{{contacts}} Contacts So far</h3>
<ul>
<li>
<span>First Name</span>
<span>Last Name</span>
</li>
</ul>
</div>
</div>
</body>
</html>
main.js
function ngAddressListController($scope)
{
$scope.contacts = [
{first_name:'Jane', last_name:'Doe'},
{first_name:'Jhon', last_name:'Doe'}
];
}
Seems Angular < 1.3 was and I should stick with that?