src/lib/extensions/json.service.ts
A JSON Parse/Stringify extension that extends the browser behavior of JSON. Supports CMFMaps and ISO 8601 Date parse/stringify.
Methods |
| parse | ||||||||
parse(text: string)
|
||||||||
|
Converts a JavaScript Object Notation (JSON) string into an object. It uses a custom reviver that handles dictionaries and ISO 8601 dates. If a member contains nested objects, the nested objects are transformed before the parent object is.
Parameters :
Returns :
any
|
| parseComplexProperties | ||||||||
parseComplexProperties(obj: any)
|
||||||||
|
Parse all string properties that start with the keyword 'function'. It should be used with the result of @see stringifyFunctionProperties.
Parameters :
Returns :
any
The object will all its function properties deserialized. |
| stringify | ||||||
stringify(data: any)
|
||||||
|
Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
Parameters :
Returns :
string
|
| stringifyComplexProperties | ||||||||
stringifyComplexProperties(obj: any)
|
||||||||
|
Stringify all function properties on the given object. Useful when there is a need to serialize objects with functions has properties.
Parameters :
Returns :
any
The object with all it's function properties serialized. |