maiyaporn / angular2-wizard

Angular2 - Form Wizard Component
118 stars 119 forks source link

How we get form control value on "Done" button Click #2

Closed sanjaypraja closed 7 years ago

sanjaypraja commented 7 years ago

Hi,

I am facing problem to get form control value on "Done" button click event "(onComplete)".

I have taken example code as you given and want to get email value on Done button Click event. also, I would another form value from second and third wizard. Please help me... _ <wizard-step [title]="'Step1'" [isValid]="emailForm.form.valid" (onNext)="onStep1Next($event)"> <form #emailForm="ngForm">

We'll never share your email with anyone else.
</form>

_

maiyaporn commented 7 years ago

You can bind the value of an input field with [(ngModel)]. In the example code, you can get the email value from 'data.email'.

<input type="email" class="form-control" id="exampleInputEmail1" name="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email" [(ngModel)]="data.email" required>

Please take a look at the code for the demo. https://github.com/maiyaporn/angular2-wizard-demo/blob/master/src/app/app.component.html https://github.com/maiyaporn/angular2-wizard-demo/blob/master/src/app/app.component.ts