Created
February 24, 2016 09:49
-
-
Save riklaunim/ae046c0225b1ecd66d47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# contextual component | |
export default Ember.Component.extend({ | |
tagName: 'h3', | |
classNames: ['timeline-header', 'no-border'], | |
icon: 'fa-envelope', | |
color: 'orange' | |
}); | |
# contextual component template (simplified): | |
{{message.survey.name}} | |
# timeline-message component yielding contextual component (dynamic names) | |
{{yield (hash | |
timelineEntry=(component messageComponent message=message) | |
) messageComponent}} | |
# timeline-message usage | |
{{#timeline-message message=message as |context messageComponent|}} | |
{{#if messageComponent}} | |
<i class="fa {{context.timelineEntry.icon}} bg-{{context.timelineEntry.color}}"></i> # this does not work | |
<div class="timeline-item"> | |
... | |
{{context.timelineEntry}} # this does work | |
</div> | |
{{/if}} | |
{{/timeline-message}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment