Running a filter from console for inspecting value

776 views Asked by At

Is there any way to run a $filter in console using inspector? Using batarang I can get the scope attached to a specific element, but I want to run a general filter on the values in scope, how can I do it?

1

There are 1 answers

0
m.brand On BEST ANSWER

I don't really know your usecase, but if it's only for debugging you could make the $filter available globally.

Just inject the $filter in some controller or whatever and move it to the window

app.controller( 'MainCtrl',
  function (  $filter )
  {
     window.$filterForDebugging = $filter;
  });

Now you can use

window.$filterForDebugging('date')(new Date(), 'medium');
// "27.08.2015 09:09:49"