mohsen1 / json-formatter

Angular directive for collapsible JSON in HTML
http://azimi.me/json-formatter/demo/demo.html
Other
372 stars 85 forks source link

Expand all, collapse all #55

Open benjamincharity opened 8 years ago

benjamincharity commented 8 years ago

Digging this module 👍

Any thoughts on adding a method to 'expand all folds' or 'collapse all folds'? Seems like it could be quite useful.

mohsen1 commented 8 years ago

Since this directive is not watching the open attribute it's not easy to add a link next to where it is rendered to do the toggle.

If you make a PR for watching the open attribute something like this should work: http://jsbin.com/vuzatohuca/edit?html,output