I call the fetchData function with the click of a button and completely retrieve the full data set, I need to pass the form view, this is the value of the element,
I want to reuse this function, and when I call this function and pass this element value, it does not call the function at all, how can I reuse this function.
$scope.fetchData = function(item) {
$scope.selectedData = item;
var entry = ServiceName.ServiceItem.query({
item: item,
}, function() {
$scope.item_array = entry;
});
}
if(some_condition)
{
$scope.item_array = $scope.fetchData($stateParams.item_val);
}
user3752338
source
share