Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to user $scope in Service #12

Open
Gajendrasinh opened this issue Oct 9, 2015 · 0 comments
Open

How to user $scope in Service #12

Gajendrasinh opened this issue Oct 9, 2015 · 0 comments

Comments

@Gajendrasinh
Copy link

$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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant