json - AngularJS extra data in request -
json - AngularJS extra data in request -
i'm trying create function sends info form server. server sends id of created entry. id should sent server info field group. i've done similar jquery, in case wasn't able force id info "data2".
it shows error "data2.push() not function". doing wrong?
$scope.createnew = function() { var info = $scope.fields1; var data2 = $scope.fields2; $http.post("myurl", data) .success(function(response) { data2.push('rid' , response.id[0]); <------- add together id response sec request $http.post("myurl2", data2) .then(function(data) { $location.url('/entry/' + response.id[0]); }); }); }
json angularjs post
Comments
Post a Comment