Is it just me, or does ng-repeat in AngularJS refuse to work with generator functions? While it functions as expected within the controller, when used within HTML expressions, it appears that the generator has already been terminated. Can someone please shed some light on this Angular mystery for a newbie like me?
function Main($scope) {
$scope.items = function*() {
//console.log(1);
yield 1;
//console.log(2);
yield 2;
return null;
}();
//console.log($scope.items);
//console.log($scope.items.next().value);
//console.log($scope.items.next().value);
}
<div ng-app ng-controller="Main">
<h2>{{items.next()}}</h2>
<div ng-repeat="item in items">
Hi {{item}}
</div>
</div>