title: Aurelia: always call method in the view (problems after upgrade)
body: <p>We've upgraded Aurelia (in particular <code>aurelia-framework</code> to <code>1.0.6</code>, <code>aurelia-bindong</code> to <code>1.0.3</code>) and now we're facing some binding issues.</p>
  <p>There's a list of elements with computed classes, and we had a method int the custom element that contained the  list:</p>
  <pre><code>getClass(t) {
      return '...' + 
             (this.selected.indexOf(t) !== -1
                  ? 'disabled-option' :
                  : ''
             ) + (t === this.currentTag 
                  ? 'selected-option' 
                  : ''
             );
  }
  </code></pre>
  <p>And <code>class.one-way=&quot;$parent.getClass(t)&quot;</code> for the list element, everything was OK.</p>
  <p>After the upgrade it simply stopped to work, so whenever the <code>selected</code> (btw it's bindable) or <code>currentTag</code> properties were modified, the <code>getClass</code> method just wasn't called.</p>
  <p>I partially solved this by moving this logic to the view:</p>
  <pre><code>class=&quot;${$parent.getClass(t) + (selected.indexOf(t) !== -1 ? 'disabled-option' : '') (t === $parent.currentTag ? 'selected-option' : '')}&quot;
  </code></pre>
  <p>I know that looks, well... bad, but that made <code>t === $parent.currentTag</code> work, but the <code>disabled-option</code> class still isn't applied.</p>
  <p>So, the question is:</p>
  <h2>How do I force Aurelia to call methods in attributes in the view?</h2>
  <h3>P.S.</h3>
  <p>I understand that it might cause some performance issues.</p>
  <h3>Small note:</h3>
  <p>I can not simply add a <code>selected</code> attribute to the list element since I don't to somehow modify the data that comes to the custom element and I basically want my code to work properly without making too many changes.</p>
  <h1>UPD</h1>
  <p><del>I ended up with <a href="https://stackoverflow.com/a/34499658/2044039">this awesome solution by Fabio Luz</a> with this small edit:</del></p>
  <p><strong>UPD</strong> Here's a way to interpret <a href="https://stackoverflow.com/a/34499658/2044039">this awesome solution by Fabio Luz</a>.</p>
  <pre><code>export class SelectorObjectClass {
      constructor(el, tagger){
          Object.assign(this, el);
          this.tagger = tagger;
      }
  
      get cssClass(){
          //magic here
      }
  }
  </code></pre>
  <p>and</p>
  <pre><code>this.shown = this.shown(e =&gt; new SelectorObjectClass(e, this));
  </code></pre>
  <p>But I ended up with <a href="https://stackoverflow.com/a/34534267/2044039">this (defining an extra array)</a>.</p>