title: angularjs scope variables are not working but works on second click
body: <p>Hi I am developing web application in angularjs. I have implemented print functionality. I am binding values to view using scope variables. When i click first time on print my values are not binding. When i click second time all my values will bind. Below is the print functionality.</p>
  
  <pre><code> $scope.Print = function () {
                  if ($scope.period == null) {
                      toastr.error($filter('translate')('Please select Year.'));
                  }
                  else {
                  $scope.vehiclepriceprint = $cookieStore.get("carpriceprint");
                  $scope.downpaymentprint = $cookieStore.get("downpayment");
        }
  </code></pre>
  
  <p>First time also i will be having values in cookie but not binding to view. Whenever i click second time on print button everything will be working
  Below is the print button.</p>
  
  <pre><code>  &lt;input type="button" value="{{'Print' | translate}}" class="blue-button"  ng-click="Print()" id="btnPrint"&gt;
  </code></pre>
  
  <p>Below is the html code of print.</p>
  
  <pre><code>   &lt;span id="lblDownPayment"&gt;{{downpaymentprint}}&lt;/span&gt;
     &lt;span id="lblFinancialAmount"&gt;{{vehiclepriceprint}}&lt;/span&gt;
  </code></pre>
  
  <p>May i know what is the issue i am facing here? Any help would be appreciated. Thank you. </p>