Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

220
Views
Why building angular forms with formcontrol.values not setting the validations

I needed to create form in this way. app.ts file ->

courseNameControl = new FormControl("", [Validators.required,Validators.minLength(2)]);

contentControl = new FormControl("", Validators.required);

form = { coursename: this.courseNameControl.value, content: this.contentControl.value, } testForm=this.fb.group(this.form)

This form does not create the validations properly. Does anyone have a clue why?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You probably don't NEED to do it this way.

Just do it properly.

testForm = this.fb.group({
  coursename: ['', [Validators.required, Validators.minLength(2)]],
  content: ['', [Validators.required]]
});

But to answer your question, your form value is

{ coursename: '', content: '' }

Do you see any validators in that ?

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!