File

src/app/shared/support/encoder.utils.ts

Description

Custom HTTP Parameter Encoder

Implements

HttpParameterCodec

Index

Methods

Methods

decodeKey
decodeKey(key: string)
Parameters :
Name Type Optional Description
key string
Returns : string
decodeValue
decodeValue(value: string)
Parameters :
Name Type Optional Description
value string
Returns : string
encodeKey
encodeKey(key: string)
Parameters :
Name Type Optional Description
key string
Returns : string
encodeValue
encodeValue(value: string)
Parameters :
Name Type Optional Description
value string
Returns : string
import { HttpParameterCodec } from '@angular/common/http';

/**
 * Custom HTTP Parameter Encoder
 */
export class DataflowEncoder implements HttpParameterCodec {

  encodeKey(key: string): string {
    return encodeURIComponent(key);
  }

  encodeValue(value: string): string {
    return encodeURIComponent(value);
  }

  decodeKey(key: string): string {
    return decodeURIComponent(key);
  }

  decodeValue(value: string): string {
    return decodeURIComponent(value);
  }

}

results matching ""

    No results matching ""