Can someone tell me why this simple angularjs jsfiddle not working?
var myApp = angular.module('myApp',[]);
myApp.controller('MyCtrl', ['$scope', function MyCtrl($scope) {
$scope.name = 'Superhero';
}]);
and
<div ng-app="myApp" ng-controller="MyCtrl">
Hello, {{name}}!
</div>
results in
Hello, {{name}}!
ng-app="myApp"
from the div
tag.<body ng-app="myApp">
.No wrap - in <body>