Applying angular $watch on filter_bar not working

I have got kibana filter_bar as below:
var queryFilter = Private(require('ui/filter_bar/query_filter'));
Now,
I wish to watch changes in queryFilter , but unexpectedly below watcher isn't working :-

var filterBar=queryFilter.getFilters();
$scope.$watch('filterBar', function(oldValue,newValue)
{
alert('filterBar changed');

console.log(oldValue); // resp getting undefined
console.log(newValue);
console.log(filterBar);
},true);

Watcher doesn't invoke even on filterBar gets updated on new filter being added , even though i have been using onjectEquality set true. Please help me on this ?

Oh, here I got the solution ,

var queryFilter = Private(require('ui/filter_bar/query_filter'));
$scope.$listen(queryFilter, 'update', function () {
  alert("query Updated");
});

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.