-
Notifications
You must be signed in to change notification settings - Fork 346
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
this again? #1496
Comments
linked to #1317 |
Behaves as expected: unqualified names are looked up on the context meaning that calling functions directly inside of templates (instead of calling them as a method on const renderingContext = {
update() {
return this.update();
}
} In general, it's advisable to never call functions using their unqualified names in templates as they will be implicitly bound to the rendering context: <div t-on-click="() => method()"/> <!-- incorrect -->
<div t-on-click="() => this.method()"/> <!-- correct -->
<div t-on-click="() => props.method()"/> <!-- correct -->
<div t-on-click="() => this.props.method()"/> <!-- correct but needlessly qualified: the method will be bound to props in both cases --> Hopefully this can help people who stumble upon this issue in the future. We will address this issue in owl 3 (for which we have no timeline as of yet) |
A subtility with this:
Click on "Update 2" brings an error "Uncaught RangeError: Maximum call stack size exceeded"
see in playground
The text was updated successfully, but these errors were encountered: