Update form issue


#1

Hi everyone. I have an issue about the sending datas for update. I use this html form to posting data. I use this input on ng-repeat. So there are many inputs inside ng-repeat. When i try to post binded data from input i got “undefined” erorr. But if i write something manually into input i can post the value. But i need to send binded data from input.

<div ng-repeat="veri in veriler">    
<form>
    <input type="text" name="mac_id" ng-model="mac_id" ng-value="veri.mac_id">
    <input type="submit" class="favourite" ng-click="addtofavourite(mac_id)">
    </form>
</div>

Then i try to post data with this code;

 $scope.veri = {};

$scope.addtofavourite = function(mac_id){
    var link = 'http://example.com/api.php';
    var mac_id = mac_id;
    var user_id = loggeduser;
    alert (mac_id);
    $http.post(link, {user_id : user_id, mac_id : mac_id}).then(function (res){
        $scope.response = res.data;
    });
};

Best regards.


#2

I also have same problem. Please help!