docs(API): 翻译完了 JsonPipe
This commit is contained in:
parent
adb6be6a02
commit
a510ed5312
|
@ -62,7 +62,7 @@
|
||||||
[ ] | animations/style | 0.25
|
[ ] | animations/style | 0.25
|
||||||
[x] | common/SlicePipe | 0.25
|
[x] | common/SlicePipe | 0.25
|
||||||
[ ] | router/Event | 0.25
|
[ ] | router/Event | 0.25
|
||||||
[ ] | common/JsonPipe | 0.25
|
[x] | common/JsonPipe | 0.25
|
||||||
[x] | forms/FormArray | 0.25
|
[x] | forms/FormArray | 0.25
|
||||||
[ ] | common/CommonModule | 0.24
|
[ ] | common/CommonModule | 0.24
|
||||||
[ ] | router/NavigationExtras | 0.24
|
[ ] | router/NavigationExtras | 0.24
|
||||||
|
|
|
@ -14,10 +14,14 @@ import {Pipe, PipeTransform} from '@angular/core';
|
||||||
*
|
*
|
||||||
* Converts a value into its JSON-format representation. Useful for debugging.
|
* Converts a value into its JSON-format representation. Useful for debugging.
|
||||||
*
|
*
|
||||||
|
* 把一个值转换成 JSON 字符串格式。在调试时很有用。
|
||||||
|
*
|
||||||
* @usageNotes
|
* @usageNotes
|
||||||
*
|
*
|
||||||
* The following component uses a JSON pipe to convert an object
|
* The following component uses a JSON pipe to convert an object
|
||||||
* to JSON format, and displays the string in both formats for comparison.
|
* to JSON format, and displays the string in both formats for comparison.
|
||||||
|
*
|
||||||
|
* 下列组件使用了一个 `JSON` 管道来把对象转换成 JSON 格式,并以两种格式显示字符串供对比。
|
||||||
|
|
||||||
* {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}
|
* {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}
|
||||||
*
|
*
|
||||||
|
@ -27,6 +31,8 @@ import {Pipe, PipeTransform} from '@angular/core';
|
||||||
export class JsonPipe implements PipeTransform {
|
export class JsonPipe implements PipeTransform {
|
||||||
/**
|
/**
|
||||||
* @param value A value of any type to convert into a JSON-format string.
|
* @param value A value of any type to convert into a JSON-format string.
|
||||||
|
*
|
||||||
|
* 任何类型的要转换成 JSON 字符串格式的值
|
||||||
*/
|
*/
|
||||||
transform(value: any): string { return JSON.stringify(value, null, 2); }
|
transform(value: any): string { return JSON.stringify(value, null, 2); }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue