I am picking an array with few object on it from an external file.
Using:
app.controller('mycontroller', function($scope, $http) {
$http.get("file")
.then(function(response) {
$scope.lols = response.data;
});});
This will give me back something like:
$scope.lols = [
{
prop1: "h1",
prop2: "h2",
},
{
prop1: "g1",
prop2: "g2",
},}
Now I want to add a prop3 in each of the objects how should I do it ? If I had the data into my js file I will do it manually but picking the data from an external file...
I have tried simply doing:
app.controller('mycontroller', function($scope, $http) {
$http.get("file")
.then(function(response) {
$scope.lols = response.data;
$scope.lols.push = [
{prop3: "h3"},
{prop3: "g3"}
]
});});
But it has not worked...
Thanks for any help or link explain it.
SOLUTION: https://jsfiddle.net/d3c96e0z/3/
$scope.games.push = [?