angularjs module and controller is not working

Viewed 217

I'm trying to create module and controller for understanding the basic concept. I tried below code but it does not 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'
    }
});

Above code is not working. Can any one guide me where i'm doing wrong.

2 Answers
Related