guides icon indicating copy to clipboard operation
guides copied to clipboard

Make it clearer where actions can be passed & used

Open jenweber opened this issue 7 years ago • 2 comments

This page in the guides talks about actions, but doesn't cover some major gotchas around where actions should be put and where they can be passed.

Examples:

  • An action defined in a controller can be passed to a route's child components
  • An action in the route's js can't be passed to a child component
  • An action in a route js can be used in the route's template directly

This should be explained somehow.

jenweber avatar Mar 23 '18 03:03 jenweber

Hi @jenweber 👋 . I wouldn't mind taking a stab at this. There is a lot to unpack when it comes to actions, however. Would it make sense to split some of this up? For instance, perhaps moving some controller specific pieces to the controllers section? There should also be some room for explaining what the action helper is doing for us (i.e. setting the context of the function). It just feels like it's a bit bigger than just the Templates section 🤔

sbatson5 avatar Apr 08 '18 19:04 sbatson5

@sbatson I agree that it’s a bigger issue than one section. I recommend separate PRs so that changes are easier to review. But you can drop some ideas here in this issue for brainstorming

jenweber avatar Apr 08 '18 20:04 jenweber