خرید بک لینک

Vote count: 0

The idea was to send true checkbox values from mobile to API so I can place an order with selected condiments, however I cant to get a grasp on it.

<ion-checkbox ng-repeat="condiment in condiments" ng-model="condiment.checked"
                          ng-checked="checkItem(condiment.id)">
                {{condiment.name}}
                {{condiment.price}}
</ion-checkbox>

It calls the function:

$scope.checkItem = function (id) {
            retu $scope.condiments[id-1].checked = true;
};

(minus 1 is because ID starts at 1, and array at 0) But it is not called when checked/unchecked, but rather it makes all my resources checked by default, and once I click to uncheck them, nothing changes.

Property 'checked' is not part of the original JSON API output for the condiment. It has ID, name and price.

Question:

Is there a less painful way to send checked ID's back to server?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 10 ارديبهشت 1395 ساعت: 13:48

صفحه بندی