title: How to bind to object in repeat.for with Aurelia
body: <p>I am currently trying to create a custom element with a bindable property and bind to that property to the variable of a repeat.for loop. This seems like it should be a simple task but I cannot get it to work and am wondering if it perhaps has to do with the variable being an object. The code for my custom element is below:</p>
  
  <p><strong><em>game-card.js</em></strong></p>
  
  <pre><code>import { bindable } from 'aurelia-framework';
  
  export class GameCard {
    @bindable gameData = null;
    @bindable name = '';
  
    bind() {
      console.log('card-game-data: ' + JSON.stringify(this.gameData, null, 2));
      console.log('name: ' + this.name);
    }
  }
  </code></pre>
  
  <p><strong><em>game-card.html</em></strong></p>
  
  <pre><code>&lt;template&gt;
    &lt;div class="card medium"&gt;
      &lt;h3 class="center-align left"&gt;${gameData.name}&lt;/h3&gt;
      &lt;div class="right-align right"&gt;${gameData.isPublic}&lt;/div&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>The view that is using the custom element is below:</p>
  
  <pre><code>&lt;template&gt;
    &lt;require from="./game-card"&gt;&lt;/require&gt;
    &lt;div&gt;
      &lt;div class="row"&gt;
        &lt;div repeat.for="game of games"&gt;
          &lt;game-card class="col s6 m4 l3" gameData.bind="game" name.bind="game.name"&gt;&lt;/game-card&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>The games object looks as follows:</p>
  
  <pre><code>[{name: 'SomeName', isPublic: true}, {name: 'AnotherName', isPublic: false}]
  </code></pre>
  
  <p>Now, when I run the code, the console.log statements in the game-card.js bind method print out undefined for the gameData, but prints out the correct name of the game for the <code>console.log('name: ' + this.name)</code> statement. I can't figure out why the binding is working when I bind to a property of the game object, but not when I bind to the game object itself. Any help would be greatly appreciated, thank you so much!</p>