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

Enable {{yield to="inverse"}} in components #11084

Merged
merged 1 commit into from
May 11, 2015

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented May 9, 2015

This creates public API for yielding to a component's inverse template. Components can receive an inverse template like:

{{#my-component}}
  Hello
{{else}}
  Goodbye
{{/my-component}}

And can yield to it from within their own template like:

{{yield to="inverse"}}

As far as I know, Handlebars does not expose a syntax for giving the inverse block parameters, so there's no practical way to use {{yield something to="inverse"}}. But nothing in this implementation precludes that from eventually working.

My immediate use case is to implement a Glimmer-compatible liquid-if as a component. This feature will also be useful to people implementing custom each-like components.

Depends on tildeio/htmlbars#340

@rwjblue
Copy link
Member

rwjblue commented May 11, 2015

Upstream PR merged and published as 0.13.17. Could you rebase and update package.json to point to that version?

@ef4
Copy link
Contributor Author

ef4 commented May 11, 2015

Working on the rebase, looks like one minor conflict with content.template.meta stuff.

@ef4
Copy link
Contributor Author

ef4 commented May 11, 2015

This is ready, CI is blocked on saucelabs.

rwjblue added a commit that referenced this pull request May 11, 2015
Enable {{yield to="inverse"}} in components
@rwjblue rwjblue merged commit 44fd58d into emberjs:master May 11, 2015
@knownasilya
Copy link
Contributor

Nice, I have always wanted this!

rlivsey added a commit to minutebase/ember-can that referenced this pull request May 11, 2015
@sandstrom
Copy link
Contributor

Awesome! 😄

kat3kasper pushed a commit to kat3kasper/ember-paper that referenced this pull request Mar 25, 2016
Inverse component templates can not recieve parameters. This means
there is no access to `searchText` in the inverse block.

- Removed inverse template rendering. Instead try to render
notFoundComponent then default to notFoundMsg
- Update documentation app to reflect these changes

See: emberjs/ember.js#11084
kat3kasper pushed a commit to kat3kasper/ember-paper that referenced this pull request Mar 25, 2016
Inverse component templates can not recieve parameters. This means
there is no access to `searchText` in the inverse block.

- Removed inverse template rendering. Instead try to render
notFoundComponent then default to notFoundMsg
- Update documentation app to reflect these changes

See: emberjs/ember.js#11084
kat3kasper pushed a commit to kat3kasper/ember-paper that referenced this pull request Mar 30, 2016
Inverse component templates can not recieve parameters. This means
there is no access to `searchText` in the inverse block.

- Removed inverse template rendering. Instead try to render
notFoundComponent then default to notFoundMsg
- Update documentation app to reflect these changes

See: emberjs/ember.js#11084
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

Successfully merging this pull request may close these issues.

4 participants