I have a method in my angular controller that returns true or false.
$scope.overallAmount = function () {
var cnt = $scope.orders.length, sum = 0;
while (cnt--)
sum += parseFloat(($scope.orders[cnt].CardAmount || 0) * ($scope.orders[cnt].Quantity || 0)) || 0;
return (500 - sum) > 0;
};
I'd like to use this for validation. Is it possible to create custom validation that just uses a scope method's true or false to validate? A snippet would be helpful, thanks