angularjs - ng-repeat stuck in infinite loop angularfire 8.2 -
i'd figure out why ng-repeat statement runs infinite. item.members has length of 2 , contains userids = true
<script type="text/ng-template" id="items_renderer.html"> <label> <span class="team-description" ng-show="!item.editing">{{item.name}}</span> <label ng-repeat="memberid in item.members"> <span>{{ getmember(memberid) }}</span> </label> </label> </script> <div ui-tree="options" class="teamlist"> <ol ui-tree-nodes ng-model="teams" class="panel-teams"> <li ui-tree-node ui-tree-handle ng-repeat="item in teams" ng-include="'items_renderer.html'"> </li> </ol> </div> $scope.getmember = (memberid) -> memberobj = fbutil.syncobject('users/' + memberid) memberobj.$loaded().then (ref) -> $scope.teamuser.push ref.name console.log $scope.teamuser return $scope.teamuser
it keep running indefinite.
["sven woldt", "sven woldt", "sven woldt", "sven woldt", "sven woldt", "sven woldt", "sven woldt", "sven woldt", "sven woldt", "yahoo", "yahoo", "yahoo", "yahoo", "yahoo", "yahoo", "yahoo", "yahoo", "yahoo", "sven woldt", "yahoo", "sven woldt", "yahoo", "sven woldt", "yahoo",…]
so how restrict return ["sven woldt", "yahoo"]
thanks help!
it indefinite because keep pushing $scope.teamuser
in $scope.getmember
function. if want display name, why not try
$scope.getmember = (memberid) -> memberobj = fbutil.syncobject('users/' + memberid) memberobj.$loaded().then (ref) -> return ref.name
Comments
Post a Comment