I have a function in commonservice and i want to call the function by sending the type as argument from another controller and how can i do that,
commonservice :
function getCommonLookupData(type) {
var data = angular.fromJson(EmployeeRoles.getItem('lookupData'));
var arr = [];
if (data)
arr = data[type];
var arr1 = [];
if (arr) {
$.each(arr, function (index, val) {
arr1.push(val);
});
}
return arr;
}
}
contrlrm :
commonService.getCommonLookupData(EmployeeRoles);
and how can i get the arr of the function,can anyone help please.Thanks.