Angular2: Find out if FormControl has required validator?

Discussão em 'Angular' iniciado por Marc, Março 14, 2025.

  1. Marc

    Marc Guest

    does someone know a way to find out for an Angular2 FormControl if the required validor is registered for the control.

    this.form = builder.group({name: ['', Validators.required]};


    Can I then query the this.form.controls['name'] control if it is a required field? I know I can check if it is valid, but that's not what I want.

    Kind regards, Marc

    Continue reading...

Compartilhe esta Página