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

conditionalExpression im FormArray #453

Open
elvispdosreis opened this issue Dec 10, 2020 · 1 comment
Open

conditionalExpression im FormArray #453

elvispdosreis opened this issue Dec 10, 2020 · 1 comment
Labels

Comments

@elvispdosreis
Copy link

I need to use a conditional validator where I need to get the value of a variable out of context

table: [null, [RxwebValidators.required({conditionalExpression:(x)=> x.firstName == 'John'})]]

ngOnInit() {
        this.userInfoFormGroup = this.formBuilder.group({
          firstName:['',[RxwebValidators.required()]],
          lastName:['',[RxwebValidators.required({conditionalExpression:(x)=> x.firstName == 'John'})]]
          prices: this.formBuilder.array([
                this.formBuilder.group({
                    table: [null, [RxwebValidators.required({conditionalExpression:(x)=> x.firstName == 'John'})]],
            ]),
        });
}

Package version

@rxweb/last

@ajayojha ajayojha added the rxweb label Dec 11, 2020
@admin1148
Copy link

 table: [null, [RxwebValidators.required({conditionalExpression:(x, y)=> y.firstName == 'John'})]],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants