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

Adds Documentation for {{action}} Handlebars helper #689

Merged
merged 1 commit into from
Apr 17, 2012

Conversation

trek
Copy link
Member

@trek trek commented Apr 15, 2012

No description provided.


Clicking "click me" will trigger the `anActionName` method of the `aView` object with a
`jQuery.Event` object as its argument. The `jQuery.Event` object will be extended to include
a `view` property that is set to the original view interacted with (in this case the `aView` object).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also a context property which is the templateContext. This is especially helpful in cases of #each

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's it set to? I don't think I've ever had one I've used set to anything other than the view.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's set to the context when the template is rendered, see http://jsfiddle.net/pangratz666/Snd6n/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it occur other than with {{each}}? I almost always end up with {{collection}} instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the better question would be "when is context not the view?" Is it when the view itself has a content?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have almost always used each so I can't tell the behavior of it when using collection. But in my example the view and context are different. If a Ember.View is added inside the each, the view and context are the same...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Trying to distill down to a documentable rule.

@wagenet
Copy link
Member

wagenet commented Apr 17, 2012

It sounds like there may be more detail to add. However, since I don't think any of this is wrong, I'm going to go ahead and pull this in. If either of you wants to add more details later I'll gladly accept another PR.

wagenet added a commit that referenced this pull request Apr 17, 2012
Adds Documentation for {{action}} Handlebars helper
@wagenet wagenet merged commit b944be7 into emberjs:master Apr 17, 2012
sandstrom pushed a commit to sandstrom/ember.js that referenced this pull request Jun 17, 2021
…rn/ember-set-body-class-1.0.1

Bump ember-set-body-class from 0.4.2 to 1.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants