Search code examples
angularjsperformancewatchng-options

Remove watchers from ng-option


I am dealing with multiple filters (~ 40) of large list (avg 500 options per select), and I am currently having some performance issues.

Basically, one of my filter code looks like below

<select ng-model = "form.task" ng-options = "option.value as option.label for option in filters.tasks"></select>

I think the fact ng-option is putting a watchcollection on my lists maybe the issue here.

Is there a way to tell angular to put his watcher only on the ref of filter.tasks ?

Regards,

Peter


Solution

  • option.value as option.label for option in ::filters.tasks

    One way binding will remove watcher from that collection.