According to the docs:
If the current $controllerProvider is configured to use globals (via
$controllerProvider.allowGlobals()), this may also be the name of a
globally accessible constructor function (not recommended).
This change arrived in Angular 1.3.0-beta.15 (changelog).
This is a change in Angular's behavior from older versions, which would recognize global functions as controllers by default. It's bad practice and shouldn't be used anyway. The ironic thing is that in order to use them, you would have to use a proper setup for your app anyway, and wouldn't want to use them at that point anyway.
So, you need to setup your app this way: ng-app="myApp
and ng-controller="MyController"
angular.module('myApp', [])
.controller('MyController', function($scope) {
$scope.author = {
'name' : 'Mohammad Mohabati',
'title' : 'Web Design',
'company' : 'MohabatiPro'
};
})
;
allowGlobals
could then be set with:
.config(function($controllerProvider) {
$controllerProvider.allowGlobals();
});
so that ng-controller="SomeFunction"
will work with a global function like:
function SomeFunction($scope) { //etc
but don't do it. :)