After angular version 1.3, declaring global controller function is disabled
You need to use a modular approach to make it work.
You must first define angular.module and then include angular components in it
Demo
angular.module('app', [])
.controller('MainController', function ($scope) {
$scope.message = "Controller Example";
})
Then change ng-appto use this moduleng-app="app"
source
share