In AngularJS, I would use:
<pre>{{object|json}}</pre>
Is there a way to do the same in PolymerJS?
Implementing a custom filter is jsonpretty simple:
json
<script> PolymerExpressions.prototype.json = function(object) { return JSON.stringify(object); } </script>
Then you can use {{object|json}}anywhere.
{{object|json}}
I don’t think so that you can create a custom element and just make your object as follows:
JSON.stringify(object)