Angularjs module and controller not working
I am trying to create a module and controller to understand the basic concept. I've tried the code below but it doesn't work.
<div ng-contoller = "MyController">
<p>
{{ author.name }}
</p>
<p>
{{ author.age }}
</p>
<p>
{{ author.sex }}
</p>
</div>
var myApp = angular.module('myApp',[]);
myApp.controller('MyController', function MyController($scope){
$scope.author = {
'name' : 'Sameer Sashittal',
'age' : '28',
'sex' : 'Male'
}
});
The above code doesn't work. Can anyone please direct me to where I am doing wrong.
+3
source to share