accepted |
There‘s no way to do this. See https://github.com/angular/angular.js/issues/263. Depending on what you‘re doing you can use a boolean to just not going into the body of the loop. Something like: var keepGoing = true; angular.forEach([0,1,2], function(count){ if(keepGoing) { if(count == 1){ keepGoing = false; } } }); |
时间: 2024-10-09 22:32:15