Can anyone tell me why this extremely basic example in Angular does not work?
<div ng-app>
<div ng-controller="DemoCtrl">
Hi, {{firstName}} {{lastName}}!
</div>
</div>
function DemoCtrl($scope)
{
$scope.firstName = "Steve";
$scope.lastName = "Smith";
}
It gives the error "Argument 'DemoCtrl' is not a function, got undefined" . . . JsFiddle is here: http://jsfiddle.net/SfU3z/
It's just an issue with how your fiddle is setup. Here's a modified example that works fine with the same code. jsfiddle.net/7TJfk/1