0
我寫了一個涉及多個循環的函數。從嵌套循環java腳本返回值
$scope.matchFunction = function() {
angular.forEach(datas, function(data) {
angular.forEach(data.innerdatas, function(nnerdata) {
if (innerdata.id === 'ABCD') {
console.log('matched');
//matched return true and break and stop executon
return true;
}
});
});
return false;
};
但是我總是在返回false。
我想我無法從嵌套循環中返回。
任何幫助。
感謝一大堆。 – Patan 2014-11-05 14:13:33