-1

I have the following snippet;

vm.products = Product.query();

$scope.$watch("vm.filterType1", function (val) {
            vm.products = $filter('filter')('id', 1);
            console.log('watcher'); 
});

html

<switch ng-model="vm.filterType1" class="green"></switch>

But nothing happends when i change the switch - nothing gets logged in the console? It runs on load, but not on change.

brother
  • 7,651
  • 9
  • 34
  • 58

1 Answers1

0

Not excatly an answer, but i used an ng-change event instead, and it worked. Thanks for the comments.

brother
  • 7,651
  • 9
  • 34
  • 58