0

I have something like this

  get formControls(): any {
    return this.form.controls;
  }

But now I have a problem with tslint. It returns the error Type declaration of 'any' loses type-safety. Consider replacing it with a more precise type. Does anybody knows what type does this.form.controls return? I have tried FormGroup, FormControl, but none was correct.

1 Answer 1

2
  get formControls(): { [key: string]: AbstractControl } {
    return this.form.controls;
  }

A collection of child controls. The key for each child is the name under which it is registered.

https://angular.io/api/forms/FormGroup#controls

Sign up to request clarification or add additional context in comments.

4 Comments

Can you please write a code answer, thanks
He did. It's exactly what you asked for - A replacement for any.
Can you please write code because ANY does not work
Thanks, this work, can you aslo help me with this question stackoverflow.com/questions/67482989/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.