Try this:
<!doctype html>
<html lang="en" ng-app="demo">
<head>
<meta charset="UTF-8">
<title>Angular Demo</title>
<script src="lib/angular/angular.min.js"></script>
</head>
<body>
<div ng-controller = "MyController">
<h2>{{author.name}}</h2>
<p>{{ author.title + ', ' + author.company }}</p>
</div>
<script>
angular.module('demo', [])
.controller('MyController', ['$scope', MyController]);
/* CONTROLLER */
function MyController($scope) {
$scope.author = {
'name':'ricky spires',
'title':'web developer',
'company':'none'
}
}
</script>
</body>
On Sunday, July 26, 2015 at 4:05:58 PM UTC-4, Ricky Spires wrote:
>
> Hello.
>
> Why is this basic controller not working ?
>
>
> All I see on the page is the {{ code }} and not the output ?
>
>
> AngularJS v1.4.3
>
>
> This is the code:
>
>
>
> <!doctype html>
> <html lang="en" ng-app>
> <head>
> <meta charset="UTF-8">
> <title>Angular Demo</title>
> <script src="lib/angular/angular.min.js"></script>
> </head>
> <body>
> <div ng-controller = "MyController">
> <h2>{{author.name}}</h2>
> <p>{{ author.title + ', ' + author.company }}</p>
> </div>
>
> <script>
> /* CONTROLLER */
> function MyController($scope) {
> $scope.author = {
> 'name':'ricky spires',
> 'title':'web developer',
> 'company':'none'
> }
> }
> </script>
> </body>
>
> Thanks
> Ricky
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.