-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
$scope.copylineItem = function() {
var copylineItems = $filter('filter')($scope.panelsObj, {
isSelected: true
});
var primaryLineNo = [];
for (var i = 0; i < copylineItems.length; i++) {
primaryLineNo.push(copylineItems[i].primaryLineNo);
}
if (primaryLineNo.length > 0) {
cfpLoadingBar.start();
APTS_PanelConfigController.cloneLineItems(cartId, primaryLineNo, function(result, event) {
if (event.status) {
if (result) {
$scope.panelsObj.splice(0, $scope.panelsObj.length);
$scope.getRules();
cfpLoadingBar.complete();
}
} else if (event.type === 'exception') {
alert(event.message);
} else {
alert(event.message);
}
});
}
};
This is my controller function i wan to transfer this function to service how can i do this and how to use scope in service