Skip to content
This repository was archived by the owner on Sep 24, 2020. It is now read-only.

Specific $scope bindings #108

Open
steveops opened this issue Aug 27, 2016 · 2 comments
Open

Specific $scope bindings #108

steveops opened this issue Aug 27, 2016 · 2 comments

Comments

@steveops
Copy link

Why must the inputs be bound to $scope.number, $scope.expiry and $scope.cvc? It would be very nice if they could be bound to any $scope property. For example my scope already has so many properties and I would like to group the stripe ones under $scope.stripe. Is this possible?

@palfaro91
Copy link

I know this question is old but I too just stumbled upon this issue. Were you able to resolve the issue @steveops ?

@thf24
Copy link

thf24 commented Jul 31, 2018

not sure if this is still relevant for someone, but in case:

you can achieve using $scope.stripe if you change in angular-payments.js in the method _getDataToSend the for(i in possibleKeys){ part to (I guess this is quite dirty but works for me):

for(i in possibleKeys){
        if(possibleKeys[i] == "number" || possibleKeys[i] == "cvc" ){
            ret[camelToSnake(possibleKeys[i])] = angular.copy(data.$parent.stripe[possibleKeys[i]]);
        } else {
            if(data.hasOwnProperty(possibleKeys[i])){
                ret[camelToSnake(possibleKeys[i])] = angular.copy(data[possibleKeys[i]]);
            }
        }
    }

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

No branches or pull requests

3 participants