main.js
MessageAdminNotificationFactory.getAttestationLanValidation().then(function(response){
var data = response.data;
console.log('attestation',data);
if(data){
angular.forEach($scope.adminDataSource,function(value,$index){
if(value.id === 'RA_ATTST_LANGUAGE'){
$scope.adminDataSource.splice($index, 1);
}
console.log('dropdown',value.id);
});
}
});
$scope.adminDataSource = [{
"uid": null,
"index": 0,
"selected": null,
"expanded": null,
"id": "RA_PLTFRM_NOTIF",
"text": "Platform Maintenance Notification",
"parentId": null,
"items": null
}, {
"uid": null,
"index": 0,
"selected": null,
"expanded": null,
"id": "RA_ATTST_LANGUAGE",
"text": "Attestation Language",
"parentId": null,
"items": null
}]
答案 0 :(得分:1)
$scope.adminDataSource = $scope.adminDataSource.filter(
function(value){
return value.id !== 'RA_ATTST_LANGUAGE';
})
Array.filter是要走的路。过滤掉任何评估为false的内容;
答案 1 :(得分:0)
从头到尾迭代数组
cout << "Book count: "; wscanf_s(L"%i", &count);
这样,在迭代时数组是否收缩无关紧要。