1

I am trying to build a wizard type form using Reactive Forms. Following is a snippet of my code

<form [formGroup]="pizzaForm" novalidate>
    <wp-wizard navBarLocation="top">
         <wp-wizard-step title="Dough">
              <input type="text" id="dough" [formControlName]="dough">

wizard and wizard-step are working without forms.

When I implement them with Reactive Forms and run the application, I'm seeing errors like below.

Cannot find control with name: '[object Object]'

I'm assuming this is because dough formControlName is not immediate child of pizzaForm formGroup. Not sure though. If that is the cause, how do I fix this problem? I have few fields in each wizard steps and I think all the fields should still belong to the same form so I can track the form validity. Or may be I should have different forms for each wizard step ?

Please let me know if more information is required to understand the issue.

6
  • Do you have a dogh varaible in the component? Commented Mar 21, 2017 at 3:48
  • Yes, I do. ~10char Commented Mar 21, 2017 at 3:49
  • And you want to pass in a string called "dough" to the [formControlName] property? Commented Mar 21, 2017 at 3:50
  • 1
    formControlName should be bound to a string if I'm not mistaken. Could you please upload a plnkr example? Commented Mar 21, 2017 at 4:00
  • 1
    you are right. I should be using formControlName="dough" instead of [formControlName]="dough". Also I did not need to create FormControl dough explicitly. Just creating it with FormBuilder will do. Thank you! Commented Mar 21, 2017 at 4:15

1 Answer 1

2

I mistakenly used [formControlName] instead of formControlName

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

Comments

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.