feat: copy pretty-printed JSON

closes #219
This commit is contained in:
Roman Hotsiy 2017-03-09 18:42:37 +02:00
parent 9ccfd52640
commit e99d66d9dd
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -27,7 +27,7 @@ export class CopyButton implements OnInit {
onClick() {
let copied;
if (this.copyText) {
copied = Clipboard.copyCustom(JSON.stringify(this.copyText));
copied = Clipboard.copyCustom(JSON.stringify(this.copyText, null, 2));
} else {
copied = Clipboard.copyElement(this.copyElement);
}