How to reduce payload when using this in AddSource(this)

15 views
Skip to first unread message

Tito

unread,
Apr 17, 2018, 12:31:56 PM4/17/18
to Angular and AngularJS discussion
Greetings,

From my UI/View I make the following calls when for example a button is pressed. ng-click="AddResource(this)"

The payload coming through is huge and fat. 

<td id="vendorresource" ><select ng-model="vendorresource" id="{{resource.resourcegroupid}} | orderBy:'resourcegroupsalaraygrade'"
 
ng-options="resource.resourcegroupsalaraygrade for resource in vm.resources" required></select><input ng-model="internalresourcecount" style="width: 50px;" type="number" required>
 
<button type="submit" class="icon-plus" class="btn btn-primary" ng-click="AddResource(this)">+</button>
</td>

How can I make it so that it is thin and focused instead of sending all kind of junk and then filtering it down by 
doing stuff like 

$scope.AddResource = function(data){
   resourcegroupid = data.resourcegroupid
}

Thanks much!
AgularJs
Message has been deleted

Chiheb Ben Jemia

unread,
Apr 23, 2018, 12:43:04 PM4/23/18
to Angular and AngularJS discussion
hi,

in the fly...
replace data by (form)... !
Reply all
Reply to author
Forward
0 new messages