Consider the piece of code below:
part of html file:
<body ng-app>
<div ng-controller="MainCtrl">{{name}}</div>
</body>
part of js file:
function MainCtrl($scope) {
$scope.name = "John";
}
I always put my controllers in some module, whose name I define in ng-app. How it works when I don't define any module ?
See Question&Answers more detail:os