vm.array1.push(content1);
vm.array2.push(content2);
I have two arrays where objects are pushed into each array at different times. The data model for each array is as follows:
vm.array1=[object1,object2,object3]
vm.array2=[object1,object2,object3]
The goal is to pass only the object from the first element of array1 along with the object from the first element of array2 to a function.
vm.save(a,b){
//save functionality success by calling API
}
Variables a and b should hold only the first elements of both arrays simultaneously, followed by the second elements, then the third, and so on...
How can I send only objects (not arrays) to the function using AngularJS?