This is just for test and learn. I am having a JSON object obj.
I want to call angular Json filter on that to format that json object and print it on chrome console. Not by any button click. Just by writing code in directly on console of chrome.
I know I can that with some online tool or offline tool as well. But I want to learn how to run a angular defined filter in a plain JavaScript.
Note:
- I can call it in view like
{{obj | Json}} - I can also call it from controller as
$filter('Json')(obj);
But I am not able to call it in pure javascript where angular is appended with script tag but not bootstrapped (started). I am able to access angular object though.
I want something like
var $filter = angular.filter(); //Since I do not have controller here
console.log($filter('Json')(obj));