title: how to redirect user using angular
body: <p>I'm trying to forward the user when he clicks on the submit button using angular into my web-app this way:</p>
  
  <p>html code</p>
  
  <pre><code>    &lt;tr ng-controller="fCtrl as fiche"&gt;
          &lt;td&gt;
              &lt;span ng-hide="fiche.canBeEdited()"&gt;&lt;/span&gt;
              &lt;span ng-show="fiche.canBeEdited()"&gt;
                  &lt;input type="checkbox" name="qualif0" ng-model="qualif0" &gt;
              &lt;/span&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;span ng-hide="fiche.canBeEdited()"&gt;&lt;/span&gt;
              &lt;span ng-show="fiche.canBeEdited()"&gt;
                  &lt;input type="checkbox" name="qualif1" ng-model="qualif1" &gt;
              &lt;/span&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;span ng-hide="fiche.canBeEdited()"&gt;&lt;/span&gt;
              &lt;span ng-show="fiche.canBeEdited()"&gt;
                  &lt;input type="checkbox" name="commentaire" ng-model="commentaire" &gt;
              &lt;/span&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;a href="#" ng-click="fiche.editLine()" title="Modifier"&gt;Modifier&lt;/a&gt;
              &lt;button type="submit" class="btn btn-primary" ng-show="fiche.canBeEdited()" ng-click="fiche.submitEdit(qualif0, qualif1, commentaire)"&gt;Modifier&lt;/button&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>(function(){
      var app = angular.module('m', [ ]);
  
      app.controller('fCtrl', function(){
          this.edit = 0;
  
          this.editLine = function(){
              this.edit = 1;
          };
  
          this.canBeEdited = function(){
              return this.edit === 1;
          }
  
          this.submitEdit = function(qualif0, qualif1, commentaire){
              this.edit = 0;
              window.location.replace('./fiche/traiter?qualif0='+qualif0+'&amp;qualif1='+qualif1+'&amp;commentaire='+commentaire);
          }
      });
  
  })();
  </code></pre>
  
  <p>But, this wouldn't work.</p>
  
  <p>How to fix this, please?</p>
  
  <p>Thanks in advance!</p>