feat(change_detection): json pipe

Closes #1957
This commit is contained in:
gdi2290
2015-05-18 09:24:52 -07:00
committed by Misko Hevery
parent 8e84f8a1c4
commit 986038242a
5 changed files with 202 additions and 3 deletions

View File

@ -209,7 +209,10 @@ bool assertionsEnabled() {
// Can't be all uppercase as our transpiler would think it is a special directive...
class Json {
static parse(String s) => convert.JSON.decode(s);
static String stringify(data) => convert.JSON.encode(data);
static String stringify(data) {
var encoder = new convert.JsonEncoder.withIndent(" ");
return encoder.convert(data);
}
}
class DateWrapper {