1

I need to do a console.log of a filter which is actually a finder, I have this

<input type="search" ng-model="query">

and in my controller I declare it this way

$scope.query = '';

if I do console.log($scope.query) nothing happens once I type in the search box, so how can I know what the filter is filtering ?

ErasmoOliveira
  • 1,416
  • 2
  • 20
  • 40
Non
  • 8,409
  • 20
  • 71
  • 123
  • Reference the following [answer](http://stackoverflow.com/questions/13743058/how-to-access-the-angular-scope-variable-in-browsers-console), you can either do it through console or install some tools. – jwang Mar 03 '15 at 17:25

1 Answers1

2

If you're just looking to observe what is being sent to the filter, how about adding a $watch on your query variable?

$scope.$watch('query', function(val) {
   console.log(val);
});

http://jsfiddle.net/Lj1vxwud/2/

seanhodges
  • 17,426
  • 15
  • 71
  • 93