Implementing IJsonConverter
Closed this issue · 1 comments
buchatsky commented
- Implementing IJsonConverter for passing cuscom static converter with two methods:
- revive() for JSON.parse
- replace() for JSON.stringify
- Implementing a set of Date converters for converting strings to Date object if they match the respective RegExp mask:
- JsonDateOnlyConverter
- JsonDateTimeOffsetConverter
- JsonDateConverter (combines the two)
export interface IJsonConverter {
// from JSON
revive?(/*this: any,*/key: string, val: any): any;
// to JSON
replace?(/*this: any,*/key: string, value: any): any;
}
...
export class AngularHttpProvider<TConverter extends IJsonConverter | void = void> implements IAjaxProvider<Response> {
constructor(protected http: HttpClient, protected jsonConverter?: TConverter) { }
...
}
buchatsky commented
Implemented in v1.0.0