Skip to content

How to user $scope in Service #12

@Gajendrasinh

Description

@Gajendrasinh

$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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions