У меня есть объект JSON, как показано ниже
{
"txt_inc_Application": {
"EWS": true,
"EWindow": true
},
"txt_inc_IncidentType": {
"Brand Damage": true,
"Internal failure": true
}
}
И я использую angular.forEach для получения значений
$scope.filterFormula=function() {
angular.forEach($scope.filters, function(filterObj , filterIndex) {
angular.forEach(filterObj, function(value , key) {
console.log(value+"--"+key)
})
})
}
Как я могу получить "txt_inc_Application" и "txt_inc_IncidentType" в цикле?
Также, когда вы вызываете функцию angular в html, как показано ниже, почему она выполняется дважды?
{{filterFormula()}}