My controllers have one function that has to be shared between more of them (now I just copied it):
example:
$scope.selectedPartner = { "Name": "", "Id": null };
$scope.selectPartner = function ($item) { $scope.selectedPartner = $item; };
$scope.getPartners = function (name) {
$scope.selectedPartner = { "Name": "", "Id": null };
return autoComplete.getPartners(name).then(function (response) {
return response.data.Partners;
});
};
And a lot of other functions. How can I make something like partnersFunctions() to include these functions to all controllers without copying?