title: Not able to access the $scope value in html, value set in $http.post success function
body: <p>I am not able to access the value of the $scope properties set on success of  $http post. I am trying to access it in index.html file. below is the code for reference, please help me in resolving it, i am new to AngularJs</p>
  
  <pre><code>var app = angular.module('formExample', []);
  app.controller("formCtrl", ['$scope','$rootScope', '$http',    
  function($scope,$rootScope, $http) {
      $scope.loginurl = 'loginsubmit.php';        
      $scope.loginFormSubmit  = function(isValid) {           
          if (isValid) {              
  
              $http.post($scope.loginurl, {"username": $scope.username,"password": $scope.password}).
                      success(function(data, status) {
                          $scope.status = status;
                          $scope.data = data;
                          $scope.isAdmin=data.isAdmin;
                          $scope.username=data.username;                          
                          location.href="Index.html";                         
                      })  
          }else{
  
                alert('Form is not valid');
          }
  
      }
  
  
  
   html form code
  
   &lt;div class="row" ng-app="formExample" &gt;
         &lt;div ng-controller="formCtrl"&gt;
            &lt;div class"col-md-8"&gt;&amp;nbsp;&lt;/div&gt;
            &lt;div&gt;username: {{$scope.username}} &lt;/div&gt;
  </code></pre>