title: Passing parameters to a function in knockoutjs viewmodel
body: <p>I have anchor tag like this</p>
  
  <pre><code>&lt;a href="#" class="btn btn-success order-btn" data-bind="attr:{'data-tiername':$data.tierName, 'data-identifier' : $parent.identifier}, click: $root.setPath.bind($data,$data.tierName, $parent.identifier)"&gt;Send values&lt;/a&gt;
  </code></pre>
  
  <p>In the viewmodel</p>
  
  <pre><code>var appViewModel = {
      setPath: function (data, tier, identifier) {
          alert(data);
          alert(tier);
          alert(identifier);
      },
  ...........
  ...........
  }
  </code></pre>
  
  <p>The result is some knockoutjs core code being displayed in alert message (possibly definitions of observable(),dependentObservable() functions and [Object object] which is empty when alerted with JSON.stringify) </p>
  
  <p>why does this work?</p>
  
  <pre><code>data-bind="attr:{'data-tiername':$data.tierName, 'data-identifier' : $parent.identifier}
  </code></pre>
  
  <p>but not this:</p>
  
  <pre><code>click: $root.setPath.bind($data,$data.tierName, $parent.identifier)
  </code></pre>
  
  <p>note that tierName is an observable(), identifier is computed()</p>
  
  <p>Where can I find more about bind() ??</p>