I am repeating same code for all the controllers.
E.g
$scope.CANCELLATION_IN_PROCESS = function(getOrder) {
return getOrder.status == 'ORDER_PLACED' && getOrder.cancellableStatus == 'CANCELLATION_IN_PROCESS' && getOrder.returnableStatus == 'NON_RETURNABLE';
}
We are using CANCELLATION_IN_PROCESS in dom view to show/hide a hard-coded message.
Is there any way to optimize the code.
I tried using services but I am unable to apply on view. The issue with param "getOrder" as it will only be available in the view and remain undefined in my controller with services.
Thanks MG