emberjs / list-view

An incremental rendering list view for Ember.js
MIT License
465 stars 116 forks source link

Add block params to {{ember-list}} helper #202

Closed tim-evans closed 8 years ago

tim-evans commented 9 years ago

I would like to use block params for list-view just like the each helper:

{{#ember-list items=items as |item index|}}
  {{index}}. {{item.name}}
{{/ember-list}}

Feedback on restrictions this causes on users would be great :)

stefanpenner commented 9 years ago

interesting

oskarrough commented 9 years ago

Is this what is needed before this will work? Need to pass a property from my controller down to the component. Or am I missing something super basic about contexts here?

{{#ember-list items=model height=500 rowHeight=40}}
  {{track-item track=content fish=controller.something}}
{{/ember-list}}
tim-evans commented 9 years ago

@oskarrough The template you provided is a good interim step for refactoring.

Your template would change to:

{{#ember-list items=model height=500 rowHeight=40 as |track index|}}
  {{track-item track=track fish=controller.something}}
{{/ember-list}}
oskarrough commented 9 years ago

@tim-evans exactly. But it doesn't work yet. Correct?

tim-evans commented 9 years ago

Correct. This isn't implemented yet.

krisselden commented 9 years ago

@tim-evans this will be how it has to work for ember 2, I'm planning on moving it away from item views.

tim-evans commented 9 years ago

@krisselden super!

ahmed1490 commented 9 years ago

Hi any update here?

raytiley commented 9 years ago

There is some initial spikes how of how list-view will work in glimmer. https://github.com/krisselden/list-view/tree/2.0.0.

You can see how the new syntax looks here: https://github.com/krisselden/list-view/blob/2.0.0/tests/dummy/app/templates/simple.hbs#L18-L22