I have this simple array and I need to make a post request to a backend controller but every time I get a empty array []
Here my html:
<div class="input-container" ng-repeat="lang in languages">
<label for="tagName">{{:: 'tagName' | translate }}</label>
<input placeholder="{{:: 'tagName' | translate }}" id="tagName" type="text" ng-model="translations[lang]">
</div>
Here my JS:
$scope.createNewTag = function () {
console.log($scope.translations);
var data = $scope.translations;
var method = 'post';
var url = './tags';
$http.post(url,data);
};
The console.log($scope.translations);
print: [en:"hello", it:"ciao"]
but when I see in Chrome console the request playload is empty and in my controller I get an empty array.
What am I missing?