本文整理汇总了TypeScript中angular2/src/facade/lang.Json.stringify方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Json.stringify方法的具体用法?TypeScript Json.stringify怎么用?TypeScript Json.stringify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/src/facade/lang.Json
的用法示例。
在下文中一共展示了Json.stringify方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: reportSample
reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise<any> {
var content = Json.stringify({
'description': this._description,
'completeSample': completeSample,
'validSample': validSample
});
var filePath =
`${this._path}/${this._description.id}_${DateWrapper.toMillis(this._now())}.json`;
return this._writeFile(filePath, content);
}
示例2:
return PromiseWrapper.resolve(this._events.map((event) => {
return {
'message': Json.stringify({'message': {'method': this._messageMethod, 'params': event}})
};
}));
示例3:
return PromiseWrapper.resolve(this._perfRecords.map(function(record) {
return {
'message': Json.stringify(
{'message': {'method': 'Timeline.eventRecorded', 'params': {'record': record}}})
};
}));
示例4: it
it("should return JSON-formatted string similar to Json.stringify", () => {
var dream1 = normalize(pipe.transform(inceptionObj));
var dream2 = normalize(Json.stringify(inceptionObj));
expect(dream1).toEqual(dream2);
});
示例5: it
it('should be able to recreate serializedHeaders', () => {
let serializedHeaders = Json.stringify(headers);
let parsedHeaders = Json.parse(serializedHeaders);
let recreatedHeaders = new Headers(parsedHeaders);
expect(Json.stringify(parsedHeaders)).toEqual(Json.stringify(recreatedHeaders));
});
示例6: _prettyPrint
_prettyPrint(value) {
this._latestRef = value;
this._latestValue = Json.stringify(value);
return this._latestValue;
}
示例7: transform
transform(value: any, args: List<any> = null): string { return Json.stringify(value); }
示例8: transform
transform(value): string { return Json.stringify(value); }