I have a collection of items that I need to add a specific key to in AngularJS using $scope
. The following code shows the initial objects:
$scope.Items = [
{name:'Jani',country:'Norway'},
{name:'Hege',country:'Sweden'},
{name:'Kai',country:'Denmark'},
];
My goal is to update each object to include an additional key like this:
$scope.Items = [
{name:'Jani',country:'Norway', edit:false},
{name:'Hege',country:'Sweden', edit:false},
{name:'Kai',country:'Denmark', edit:false},
];