I have this code :
$http(req).then(function success(response) {
// $scope.table = { fields: [1,2] };
$scope.table = { fields: [] };
for (var i = 0; i < 9; i++) {
// add elements from response to $scope.table
}
});
The question is: how do I add elements to my variable $scope.table?
As we know, variables in JavaScript are not strongly-typed. I can't find any documentation that explains how to manage a type generated by something like this { ID: [] }.