Ng-Options Expression Repeatedly Called

后端 未结 2 805
我寻月下人不归
我寻月下人不归 2021-01-21 21:57

I am having multiple issues with my

提交评论

  • 2021-01-21 22:36

    The getOtherOrderDates will be called in each digest cycle so that angular knows whether to update options in select. That's most likely the reason you're seeing this method being called many times.

    If you're worried about performance impact of this loop you can build the options upfront inside your controller store it in $scope like so:

    $scope.options = $scope.getOtherOrderDates($scope.Bread.text);
    

    whenever $scope.Bread.text changes and then use $scope.options inside your template.

    0 讨论(0)
  • 提交回复
    热议问题