Skip to content

Instantly share code, notes, and snippets.

@AmilKey
Created May 19, 2015 09:41
Show Gist options
  • Select an option

  • Save AmilKey/b5b0009f8cea9f445e34 to your computer and use it in GitHub Desktop.

Select an option

Save AmilKey/b5b0009f8cea9f445e34 to your computer and use it in GitHub Desktop.
component as collectionView
{{#list-block content=widgets}}
item value {{value}}
{{/list-block}}
to
<ul class='list-block'>
<li class='list-block__item'>
item value drawer-value
</li>
<li class='list-block__item'>
item value hot-drawer-value
</li>
<li class='list-block__item'>
item value ext-drawer-value
</li>
<li class='list-block__item'>
item value super-drawer-value
</li>
</ul>
App.ListBlockComponent = App.BaseBlockComponent.extend
layoutName: "components/core/list-block/template"
tagName: 'ul'
#template
{{#each item in content}}
{{list-block-item content=item}}
{{/each}}
App.ListBlockItemComponent = App.BaseElementComponent.extend
tagName: 'li'
init: ()->
@_super arguments...
template = Ember.get @, 'parentView.template'
Ember.set @, 'layout', template if template
content = Ember.get @, 'content'
@_context = content if content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment