I am working on submitting a form to a query on a php page and returning a table of data. If I don't submit parameters, this works great. However if I try to add parameters to the post (to be used in the query), I receive an ngRepeat:Dupes error.
Any ideas as to what could cause this? Still relatively new to angular
$http.post(url ,// Application module
var reportRequest = angular.module('reportRequest',[]);
reportRequest.controller('reportRequest', function($scope, $http) {
// create a blank object to handle form data.
$scope.report = {};
// calling our submit function.
$scope.submitForm = function() {
// Posting data to php file
$http.post(url, {
"selectPerson" : $scope.report.firstname
}).success(function(data){
// Stored the returned data into scope
$scope.people= data;
console.log(data);
});
};
});
<table class="table table-hover">
<tr>
<th>First Name</th>
<th></th>
<th></th>
</tr>
<tr ng-repeat="person in people track by $index | filter:search_query">
<td><span>{{person.firstname}}</span></td>
</tr>
</table>
Copyright Notice:Content Author:「dallas」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/44202508/ngrepeat-dupes-when-posting-data-with-angular