Uh oh!
There was an error while loading. Please reload this page.
docs: account for this context - #28720
Conversation
| * selected (i.e. unused for exactly 1). By default, the header | ||
| * text is set to "numberOfDates days". | ||
| * | ||
| * Developers who wish to access "this" inside of the function |
There was a problem hiding this comment.
| *Developerswhowishtoaccess"this"insideofthefunction | |
| *Angulardeveloperswhowishtoaccess"this"insideofthefunction |
Should it specify the framework? My concern is that other framework users might get confused with the comment.
averyrousseau
left a comment
There was a problem hiding this comment.
I question if this is the best way to document this tip, for a few reasons:
- It creates a lot of duplicate text, which is annoying to maintain.
- I can see us easily forgetting to add the same tip to any future function props.
- It seems to be Angular-specific -- I was unable to access the right
thisin React (using an arrow function) or Vue (using.bind(this)). If it does actually apply to React or Vue, but my example is just subtly wrong, that only speaks to the need for example code somewhere.
Maybe we could put it in Development Tips instead? Or a page in the Angular-specific docs if it really is only relevant to Angular? I know that's not as discoverable, but my understanding is that this isn't an Ionic-specific issue, so I'm unsure if we need to give it much priority in the docs.
averyrousseau
left a comment
There was a problem hiding this comment.
LGTM aside from a component that was missed when updating to the link.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Amanda Johnston <90629384+amandaejohnston@users.noreply.github.com>
Issue number: N/A
What is the current behavior?
In #28694 there was some confusion around how to access
thisinside of a callback function passed to a property on Ionic components. The root issue was due to how thethiscontext is determined with developers being responsible for setting the appropriatethiscontext.What is the new behavior?
Does this introduce a breaking change?
Other information
Note: The link in the docs will not work until ionic-team/ionic-docs#3333 is merged.