i am using angularJs for my single page application. I have two controllers like "ControllerOne"
and "Controllertwo"
. I have some common functions for these two controllers. I will call that functions from Controllerone html and Controllertwo html files.
currently i wrote those common functions in root controller. Now i can access from any html file.
Is it possible to write those common functions to other controller or service instead of from root controller?
Fro example my common functions are like follow:
$scope.shareLivestream = function (Id) {
$scope.Id = Id;
ngDialog.open({
template: 'modules/livestream/html/share.html',
scope: $scope,
controller: "shareController"
});
}