import { Component } from '@angular/core' ; import { QueryParamBuilder , QueryParamGroup } from '@ngqp/core' ; declare const require ; @ Component ( { selector : 'demo-serializer-example' , templateUrl : './serializer-example.component.html' , } ) export class SerializerExampleComponent { public paramGroup : QueryParamGroup ; public markup = require ( '!raw-loader!./serializer-example.component.html' ) . default ; public typescript = require ( '!raw-loader!./serializer-example.component.ts' ) . default ; constructor ( private qpb ) { this . paramGroup = qpb . group ( { status : qpb . booleanParam ( 'status' , { serialize : ( value ) : string => value ? 'active' : 'inactive' , deserialize : ( value ) : boolean => ! value || value === 'active' , } ) , } ) ; } }