title: KO data-binding "text:" to a function with a parameter
body: <p>Is it possible in any way to do the following without have to pass through temporary observables / computed observables?  I have common data which is used for lookups to display data:</p>
  
  <pre><code>&lt;span data-bind="text: lookupContactName(31)"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>result: function is exectuded, parameter is found, logic ok, and computed full name is returned, but not displayed (probably since no observable)</p>
  
  <pre><code>&lt;span data-bind="text: lookupContactName(contactId)"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>result: contactId is not parsed so the correct parameter value is not visible.</p>
  
  <p>I suppose for this to work correctly i would need to create custom bindings?</p>
  
  <p>in general: i started doubting a bit whether or not my approach to load data only once and try to match up id's is a good approach.  any views?  i'm better of creating joined db tables / views / SP's?</p>
  
  <p>Thanks,
  J.</p>
  
  <p>here, are the relevant code pieces i'm using...  I will learn jsfiddle for future help.</p>
  
  <p>ALL ALERT's are returning the expected values... but still the text data-binding doesn't receive the value</p>
  
  <p>A common data library:</p>
  
  <pre><code>customers.Contact = function () {
      var self = this;
  
      id = ko.observable();
      title = ko.observable();
      givenname = ko.observable();
      surname = ko.observable();
      fullName = ko.computed(function () {
          return title()+". "+givenname()+" "+surname();
      });
  
      return {
          id: id,
          title: title,
          givenname: givenname,
          surname: surname,
          fullName: fullName
      };
  };
  customers.ContactList = function () {
  
      var self = this;
  
      contactList = ko.observableArray([]); //.publishOn("ContactList");
  
      loadContactData = function () {
          var self = this;
  
          customers.helperDataService.getContactData(loadContactDataCallBack);
      };
  
      loadContactDataCallBack = function (json) {
          var self = this;
  
          $.each(json, function (i, p) {
  
              var contact = new customers.Contact().id(p.Id)
                                                    .title(p.Title)
                                                    .givenname(p.Name)
                                                    .surname(p.Surname);
  
              contactList.push(contact);
          });
  
      };
  
      lookupContactName = function (id) {
          var self = this;
  
         alert("value to be found: "+id);
  
          ko.utils.arrayForEach(contactList(), function (contact) {
              alert("SEARCH:  contactid: " + contact.id() + " - " + "id: " + id);
              if (contact.id() === id) {
                  alert("FOUND: contactid: " + contact.id() + " - " + "id: " + id);
                  alert("value:" + contact.fullName());
                  return contact.fullName();
              }
          });
      };
  
      return {
          loadContactData: loadContactData,
          lookupContactName: lookupContactName
      };
  };
  </code></pre>
  
  <p>Which is called from here... (i changed it to contactId() and this passes the correct value to the function)</p>
  
  <pre><code>&lt;div&gt;Creator: &lt;span data-bind="text: lookupContactName(contactId())"&gt;&lt;/span&gt;&lt;/div&gt;
  </code></pre>