I have two arrays,I want to merge them into one array to bind the Data to the HTML form,this is what I did:
Controller:
$scope.modifierOuCreerArticle = function() {
var index = this.row.rowIndex;
$http.get("URL1")
.success(function(datagetArticle) {
$scope.finalOperationsList = datagetArticle.listElementGamme;
var v = $scope.finalOperationsList[$scope.finalOperationsList.length-1].operationId;
$scope.listOperationsById(v);
$scope.listfinal=$scope.finalOperationsList.concat($scope.listOperationsById);
$scope.finalOperationsList = $scope.listfinal;
});
$scope.listOperationsById = function(id) {
$http.get(URL2)
.success(function(data) {
$scope.listOperationsById = data;
});
}
I want to merge the content of "finalOperationsList" array and "listOperationsById" array and send the content to my form with the "listfinal"
but I get this in console:
$scope.listfinal :[{ content of finalOperationsList},null]
so please how can I correct my code to get the all data coming from the merge of "finalOperationsList" and "listOperationsById" arrays thanks for help
}) formodifierOuCreerArticle.$scope.listfinal = $scope.finalOperationsList.concat($scope.listOperationsById);