title: angularjs : trying to display a template when page submited
body: <p>I have a form when submitted will evoke  "ng-submit="submit()" function inside the WelcomeController. </p>
  
  <p>here i make an ajax request and checks if there is a status is equal to success. the status may not be updated in the DB when the ajax call is done.So i have set a settimeout to call make the ajax request again and again every 6 seconds till we get a status as success. What i want is to during this checking time is to  load another template. </p>
  
  <p>this is the code. </p>
  
  <pre><code>app.controller('WelcomeController', function($http,$scope,$location){
     $scope.email="abcd@test.com";
  
  
      $scope.submit = function(){
          //some way to set a new template
          $http({
              method: "POST",
              url: 'check',
              data: {email: $scope.email},
         }).success(function(data){
           if(data=="mailreceived"){
                  //redirect to another page
                 window.location.assign("./score");
           }else{
               //rcheck again if the status is set
               setTimeout( $scope.submit, 6000 );
                return false;
           }
         });  
       }
  })
  </code></pre>