When I loop through the $http post service for Angularjs
for (var i = 0; i < $scope.tagStyles.length; i++) {
$scope.profilTag.tag = $scope.tagStyles[i].
You may want to use AngularJs promise API.
var promiseArray = [];
for (/*your loop statements*/) {
promiseArray.push($http.post('/url', $scope.var));
}
$q.all(promiseArray).then(function(dataArray) {
// Each element of dataArray corresponds to each result of http request.
});
See Usage->returns section in $http service docs, to understand what is returned via dataArray parameter.