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?
Asked
Active
Viewed 771 times
0
-
This is a better answer http://stackoverflow.com/questions/37399331/how-can-i-access-and-test-an-angularjs-filter-from-the-browser-console – Gabriel Furstenheim Aug 18 '16 at 10:16
1 Answers
0
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"

m.brand
- 658
- 5
- 12