I'm trying to call a function that sits inside a angular controller from outside the controller. My code looks similar to this:
var myApp = angular.module('myApp'[])
.controller('MainController', ['$scope', function($scope) {
$scope.message = function() {
alert('Hello World');
};
}]);
function talk() {
// message()
}
What I want to accomplish is to access my message() function from inside my talk() function.
Because in my application there is a lot of code involved, that would be the easiest way for me, but if you know a better solution please tell.
Thanks!