title: show success message in $http response
body: <p>I am trying to show one <code>success</code> message in http response for 3secs,then I need to redirect the page.<br>This is my code</p>
  
  <pre><code>&lt;body ng-app='myApp' ng-controller='myCtrl'&gt;
      &lt;div class="col-lg-12 col-sm-12 col-xs-12 alert alert-success" ng-show="successMessage"&gt;
              &lt;strong&gt;&lt;/strong&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  
  &lt;script&gt;
      var app = angular
          .module("myApp",[])
          .controller("myCtrl", function ($scope, $http, $timeout) {
  
              $http.post('/user/userList').then(function (response) {
                  $scope.successMessage = "Form submitted successfully";
                  $scope.successMessage = true;
                  $timeout(function () {
                      $scope.successMessage = false;
                  }, 5000);
  
                  //growl.success('Form submitted successfully!', { title: 'Success!' });
                  window.location = '/user/userList';
              })
  
          })
  
  &lt;/script&gt;
  </code></pre>
  
  <p>But Its not showing the message in my <code>success box</code>.It just shows the empty success box for only 1 sec and immediately redirects the page.</p>