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

uncaught TypeError: _this.change.apply is not a function #65

Open
caltabid opened this issue Aug 30, 2019 · 2 comments
Open

uncaught TypeError: _this.change.apply is not a function #65

caltabid opened this issue Aug 30, 2019 · 2 comments

Comments

@caltabid
Copy link

I also switched to "develop" branch for SCA and I think there is an error in addon/components/stripe-element.js, line 86:
this.change(stripeElement, ...args);
when I use it I get the error:
"uncaught TypeError: _this.change.apply is not a function"
Should it be called like the others
this._invokeAction('change', stripeElement, ...args)
?

@caltabid
Copy link
Author

With the above modification (this._invokeAction) there was no error but the action was not bubbled to my callback.
Can this be related to the Ember version?
I'm using Ember 2.18.
I fixed this by reverting the code back to "this.sendAction" as implemented in the master branch.

@lindyhopchris
Copy link
Contributor

Hi! So I think it should be changed to this._invokeAction('change', stripeElement, ...args) as you say. Can you submit a PR for just that fix?

_invokeAction calls a closure action that you pass in... i.e it won't bubble. So you'd need to provide an action to the element rather than using bubbling... this is the same for all the other actions. The readme needs to be updated as it's out of date, plus we're planning on renaming them onChange etc to make it clearer that they are not actions that bubble - see #55

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

2 participants