Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajout de rawValueChanges #34

Open
Jtplouffe opened this issue Mar 3, 2022 · 0 comments
Open

Ajout de rawValueChanges #34

Jtplouffe opened this issue Mar 3, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Jtplouffe
Copy link
Contributor

Dans le même principe que value vs getRawValue(), quand on utilise valueChanges, les object qu'on reçoit sont des Object, qui n'on pas le prototype du form, ce qui fait qu'on ne peu pas call de méthod / getter sur les values.

Ça serait nice d'avoir un getter rawValueChanges qui émet des value avec le prototype du form.

Pour l'instant j'utilise ça, mais il y a peu être une meilleur façon de faire

private get hoursFormArrayRawValueChanges(): Observable<BusinessHoursDayHoursForm[]> {
    return this.hoursFormArray.valueChanges.pipe(
        map(_ =>
            // The value that we get in valueChange is an Object, without the prototype of the form, so we must map
            // to getRawValue() in order to use methods / getters on the prototype
            this.hoursFormArray.getRawValue()
        )
    );
}
@Jtplouffe Jtplouffe added the enhancement New feature or request label Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant