I\'m looking for a way to pass a filtered array to a directive:
I\'ve tried the following:
Your both questions are related to each other.
You can apply filter on on ng-model, but you should not do that. Because it will give you error you are facing in your second question.
When you pass filter job to your directive, angular will place a watch on your jobs variable. So when jobs gets assigned in directive watch get called, which will trigger filter again, and this will goes on until maximum digest cycle reached by angular.
To avoid this situation, you can create a filter method and pass that method in ng-model. This way you can avoid both copy creation and maximum digest cycle error.