i'm new in AngularJs (started an couple hours ago) and i'm trying to complete the AngularJs in 60 minutes'ish tutorial. But i got stucked on the first controllers example. This is my code:
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<title>Angular Js</title>
<meta charset="iso-8859-1">
</head>
<body>
<div class="container" data-ng-controller="CustomerController">
<input type="text" ng-model="name"> {{name}}
<ul>
<li data-ng-repeat="cust in customers">
{{ cust.name}} - {{cust.city}}
</li>
</ul>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.17/angular.js"></script>
<script>
function CustomerController($scope)
{
$scope.customers = [
{name:'Leonardo', city:'Phoenix'},
{name:'Michelangelo', city:'Los Angeles'},
{name:'Rafael', city:'New York'},
{name:'Donatello', city:'Texas City'}
];
}
</script>
</body>
</html>
This is the error i got from the ChromeDev Console:
Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify th...<omitted>...2) angular.js:78
(anonymous function) angular.js:78
(anonymous function) angular.js:4003
forEach angular.js:328
loadModules angular.js:3964
createInjector angular.js:3904
doBootstrap angular.js:1500
bootstrap angular.js:1515
angularInit angular.js:1427
(anonymous function) angular.js:23362
trigger angular.js:2653
(anonymous function) angular.js:2933
forEach angular.js:328
eventHandler angular.js:2932
As a newbie, I dont want to get into injector or modules and stuff. Since the tutorial is get to work only with this piece of code.
Thanks!