<td> <a href=""><span ng-click="loadView(result)">{{ result.invoiceNo }}</span></a> </td>where loadView is defined in one controller and it's:
$scope.loadView = function (invoice) { $scope.$parent.$parent.showForm = false; $scope.$parent.$parent.showSearch = false; $state.go('edit.invoices', { invoiceId: invoice.invoiceNo, accountNameHash: $scope.acctNameHash }); $rootScope.$broadcast('sm:focus'); };So, somehow I'd like to share this function between 3 controllers. I do not see this function as part of the service, obviously.