Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49188

Update form issue

$
0
0

@parabahis wrote:

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.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>