In AngularJS I would use:
<pre>{{object|json}}</pre>
Is there a way to do the same thing in PolymerJS?
The implementation of a custom json
filter is quite simple:
<script>
PolymerExpressions.prototype.json = function(object) {
return JSON.stringify(object);
}
</script>
Then you can use {{object|json}}
anywhere you like.
I don't think so out of the box, you could create a custom element and just render your object as:
JSON.stringify(object)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With