FarazShuja
FarazShuja

Reputation: 2370

Running a filter from console for inspecting value

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?

Upvotes: 0

Views: 775

Answers (1)

m.brand
m.brand

Reputation: 658

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"

Upvotes: 0

Related Questions