title: Button not hitting if statement in Knockout js
body: <p>I have the following button</p>
  
  <pre><code>    &lt;div class="pull-right" data-bind="tooltip: { title: DashboardEdit, placement: 'top' }"&gt;
      &lt;button class="btn actionButtonIcon" id="DashboardEdit" data-bind="click: changeButtonText"&gt;
          &lt;figure&gt;
              &lt;img src="../../../Images/NotesPink.png" /&gt;
              &lt;figcaption data-bind="text: $data.ProcurementbuttonText() ? 'Save': 'Edit'"&gt;&lt;/figcaption&gt;
          &lt;/figure&gt;
      &lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>It changes text when clicked, now what i am trying to achieve is when the button text is showing Save then it should execute a function, so i tried this: </p>
  
  <pre><code>            self.ProcurementbuttonText = ko.observable(false);
  
          self.changeButtonText = function(){
              self.ProcurementbuttonText(!self.ProcurementbuttonText())
              if (self.ProcurementbuttonText() === 'Save'){
              var data = {
                  'ScorecardId':ko.observable(localStorage.getItem('scorecardId'))(),
                  'DashboardConfig':ko.observable(localStorage.getItem('ElementDataWidget'))()
              };
              PreferentialProcurementDashboardApi.Save(data);           
          }
      }
  </code></pre>
  
  <p>so when <code>ProcurementButtonText = save</code> then it should do all that which is in the if statement, but i see its never hitting that if statement</p>
  
  <p>What am i doing wrong?</p>