I need to create an object using the angular.forEach()
function and then push another object while initializing all values to false. However, the current approach is causing errors.
How can I achieve this correctly? Using "item.id" and "index.id" does not result in the desired functionality. Here is a photo illustrating what I am trying to accomplish: link for image
angular.forEach(metaData.validationRules, function (item, key) {
// want to push object to another object
angular.forEach(insarray.instances, function (index, key) {
$scope.select = {
item.id: {
index.id:false
}
}
});
});