How to access observable values?

250 Views Asked by At

This is a model and I am trying to access its values. But value is in Symbol(_latestValue) and I am not sure how I can access that value.

define(['services/SessionService'],
  function(SessionService) {
    var uiModel = function(index, data) {
      this.origData = data;
      this.sessionID = data.sessionID;
      this.rowNumber = index + 1;
      this.FullName = ko.observable('');
      this.accountId = ko.observable('');
      this.organizationId = ko.observable('');
      this.userId = ko.observable('');
      this.BuyerEmail = ko.observable('');
      this.Address = ko.observable('');
      this.loadSessionInfo();
    };

    uiModel.prototype.loadSessionInfo = function() {
      var self = this;
      var service = new SessionService();

      service.getSessionInfo(this.sessionID).then(function(result) {
        self.FullName(result.Buyer1Name);
        self.BuyerEmail(result.BuyerEmail);
        self.Address(result.Address);
        self.accountId(result.AccountID);
        self.organizationId(result.OrganizationID);
        self.userId(result.UserID);
      });
    };
    return uiModel;
  });

Attached is the image that shows values that I am receiving are in Symbol(_latestValue). enter image description here

0

There are 0 best solutions below