Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $scope.sendValues = function () {
- MyService.function1($scope.value1, $scope.value2);
- for(var i = 0; i < $scope.arr.length; i++) {
- $scope.value3 = $(".input" + i).val();
- MyService.function2($scope.value3);
- }
- };
- var tempID = 0;
- var function1 = function (value1, value2) {
- return $http({
- method: 'POST',
- url: "someUrl",
- data: {
- valeu1: value1,
- value2: value2
- }
- }).success(function (response) {
- tempID = response.data.id;
- });
- };
- var function2 = function (value3) {
- return $http({
- method: 'POST',
- url: "anotherURL",
- data: {
- value3: value3,
- tempID: tempID
- }
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement