I am getting this error Argument 'MyController' is not a function, got undefined when I am trying to run code below.
<!DOCTYPE html>
<html lang="en" ng-app>
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<title>Hello world from Prateek</title>
</head>
<body>
<div ng-controller="MyController">
<h1>{{author.name}}</h1>
<p>{{author.title + ', ' + author.company}}</p>
</div>
<script>
function MyController($scope) {
$scope.author = {
'name': 'J Doe',
'title': 'Designer',
'company': 'ABC XYZ'
}
}
</script>
</body>
</html>
I want to get the name, title and company to be displayed, instead I am getting output as below
{{author.name}}
{{author.title + ', ' + author.company}}