I am illustrating a stacked graph along with its table and fetching its json data with $http.get()
and setting it to $scope.dataset
html:
<input ng-model="_searchQuery.key1.key2">
<tr ng-repeat="(key, value) in dataset | filter:_searchQuery ">
I how can I update $scope.dataset
in controller?
_searchQuery
matches dataset
and filters my table like charm. no need to code any thing in controller. ie dataset.key1.key2
reflects to _searchQuery.key1.key2
but for my nvd3.js stacked graph I have to filter the $scope.dataset
the same way in DOM. $scope.dataset = $filter('$scope._searchQuery.key1.key2')($scope.dataset)
throughs an err. Im following angular documentation and this link: How to use a filter in a controller?