Specifies that FiltersService must coerce values when serializing or parsing data.
For example, 'null' string will be converted to null, 'true' string will be converted to boolean true
, '1.0' string will be converted to 1.0 number etc.
To achieve this functionality FiltersService uses coerceValue function.
Default value that will be used to reset target property
value via FiltersService.resetValues method call.
If this option wasn't specified, FiltersService uses the value of target property
which was assigned to it at the moment of first call
of FiltersService.resetValues, FiltersService.applyParams or FiltersService.getRequestState.
Specifies that any falsy value (e.g. empty string) must be converted to null by FiltersService.getRequestState method.
When this property is set to true
, FiltersService.applyParams method skips value parsing and doesn't apply anything to target property
.
Commonly this property is useful if you have some custom logic of building 'target property' value and you want to apply it by yourself.
Specifies that property will be omitted by FiltersService.getRequestState method if it has null
or undefined
value.
Name of parameter which will be used to build request object with FiltersService.getRequestState
Name of target property
in target type
which will be used by FiltersService to read and write values.
You don't need to specify this property when using filter annotation since filter sets it automatically.
Optional function that will be called by FiltersService.applyParams to parse raw value before writing it to target property
.
Also, when this function is specified, it will be called by FiltersService.resetValues since FiltersService.resetValues clones default values as literals and resulting value can require parsing.
Optional function to serialize target property
value when FiltersService.getRequestState method builds resulting state object.
Generated using TypeDoc
Represents settings which can be used to configure FiltersService behavior (e.g. via filter annotation).
Let's define several terms for better understanding.
//Instance of this class is registered in filtersService via call of "registerFilterTarget" method below. //We call such declarations "target type". class EndUserClass { //this property has @filter annotation. We call such properties "target property" @filter public parameter1 = 'Hey'; //this property doesn't. So, it's not "target property" public parameter2 = 'There'; } let endUserClassInstance = new EndUserClass(); let filterService = new FilterService(); // This means that filtersService will operate on this specific instance since it was registered with registerFilterTarget. // We call such objects instances "target object". filterService.registerFilterTarget(endUserClassInstance);