Trying to think about how to build a multi step form in angular 2

后端 未结 2 588
情书的邮戳
情书的邮戳 2021-02-02 15:46

I am trying to build a small, 3 step form. It would be something similar to this:

The way I did this in react was by using redux to track form completion and r

2条回答
  •  独厮守ぢ
    2021-02-02 16:23

    don't overdo it, if it is a simple form you don't need to use the router or a service to pass data between the steps.

    something like this will do:

    
    
    

    It's still a small template, and you kan keep all of the form and all the data in one component, and if you want to you can replace the ngIf with something that switches css-classes on the step1,2,3 -divs and animate them as the user moves to the next step

提交回复
热议问题