TNG / ngqp

Declaratively synchronize form controls with the URL

Home Page:https://tng.github.io/ngqp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Programmatically set value of parameters inside a partition

Airblader opened this issue · comments

What does the bug look like?

It should be possible to comfortable programmatically set the value of a query parameter inside a partitioned query parameter. There was a user report that there might be issues with that, so we need to triage, verify, fix and add a test for it.

How can this bug be reproduced?

public set max_age(value: number) {
    (this.paramGroup.get('ageRange') as PartitionedQueryParam<number>).queryParams[1].setValue(value);
}

Additional context

What does work is setting the value of the entire partitioned parameter:

public set max_age(value: number) {
    this.paramGroup.get("ageRange").setValue([paramGroup.get("ageRange").value[0], value]);
}