Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4829

List of Components always get the first property

$
0
0

@tangmonk wrote:

For better explain, I have following code (not really)

app/components/building-list.js:

import Ember from 'ember';

export default Ember.Component.extend({
  router: Ember.inject.service(),
  actions: {
    click(){
      var building = this.get('building');
      console.log(building)
    }
  }
});

app/templates/components/building-list.hbs:

<div {{action 'click'}}>

and in app/templates/buildings.hbs:

{{#each model as |building|}}
    {{#building-list building=building}}
{{/each}}

So, When I click the whatever building-list div, it always log the first building to me

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4829

Trending Articles