I have a problem with forwarding the user to a new page when they click on the submit button in my Angular web app. Here is the code I am using:
html code
<tr ng-controller="fCtrl as fiche">
<td>
<span ng-hide="fiche.canBeEdited()"></span>
<span ng-show="fiche.canBeEdited()">
<input type="checkbox" name="qualif0" ng-model="qualif0" >
</span>
</td>
<td>
<span ng-hide="fiche.canBeEdited()"></span>
<span ng-show="fiche.canBeEdited()">
<input type="checkbox" name="qualif1" ng-model="qualif1" >
</span>
</td>
<td>
<span ng-hide="fiche.canBeEdited()"></span>
<span ng-show="fiche.canBeEdited()">
<input type="checkbox" name="commentaire" ng-model="commentaire" >
</span>
</td>
<td>
<a href="#" ng-click="fiche.editLine()" title="Modify">Modify</a>
<button type="submit" class="btn btn-primary" ng-show="fiche.canBeEdited()" ng-click="fiche.submitEdit(qualif0, qualif1, commentaire)">Modify</button>
</td>
</tr>
app.js
(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('./file/process?qualif0='+qualif0+'&qualif1='+qualif1+'&commentaire='+commentaire);
}
});
})();
However, this solution does not work as expected.
Can anyone provide guidance on how to resolve this issue?
Thank you!