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

Allow re-use of components in templates #272

Closed
wants to merge 2 commits into from

Conversation

bgantzler
Copy link
Contributor

This is NOT intended to be a merged request, but to give you an example of what you might do. I created a component called named-components and using hash and yeild allow the re-use of the same component multiple times in the same template. Look at the models-table.hbs for use of the named-component. Figured it would make your templates easier to maintain.

@onechiporenko
Copy link
Owner

@bgantzler, thanks for idea. I believe into this RFC emberjs/rfcs#200 and hope it will be implemented. Currently I'm thinking about with-usage. Actually I'm thinking about two things. First one - should I use with to refactor templates? Second one - how I missed with for such long time?

@bgantzler
Copy link
Contributor Author

I knew about the RFC, but since it wasnt done yet, thought this would work. I used with a long time ago, people were over using it, and it led to problems. I should have checked it again before I created this because it looks like I just recreated with :)

Yes, I think you should use with in this case. Its backward compatible and available now.

@bgantzler bgantzler deleted the namedcomp branch December 5, 2017 22:09
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.

3 participants