无限$ digest循环 - 重复

时间:2018-04-11 03:29:54

标签: angularjs angularjs-ng-repeat

我在尝试循环播放以下ng-repeat时收到错误Infinite $digest Loop

<select ng-options="item.QuoteId as item.Quote for item in smallGroup.getQuotesByRating(control.vlcSI['recSet']) track by $index">
    <option value="">Select Quote</option>
</select>

我有以下JS功能:

          function getQuotesByRating(quotes){
                var quoteList = [];
                if(typeof quotes != 'undefined' && quotes.length > 0){
                    quotes.map(function(item){
                        if(item.RatingType == 'Member & Composite'){
                            item.Quote =  item.Quote + ' : Member Rated'
                            quoteList.push(item);
                            item.Quote =  item.Quote + ' : Composite Rated'
                            quoteList.push(item);
                        }
                        else{
                            item.Quote =  item.Quote + ' : ' + item.RatingType
                            quoteList.push(item);
                        }
                    });
                    return quoteList;
                }
                return quotes;
          }

对于这种情况,可能的解决方案是什么?

0 个答案:

没有答案