Angular 2 - large scale application forms' handling

前端 未结 4 1558
青春惊慌失措
青春惊慌失措 2020-11-28 10:07

At the company I’m working for, we’re developing a large scale application with multiple forms, that the user needs to fill in in order to register for our program. When all

4条回答
  •  旧时难觅i
    2020-11-28 10:34

    Is it really necessary to keep the form controls in the service? Why not just leave the service as the keeper of data, and have the form controls in the components? You could use the CanDeactivate guard to prevent the user from navigating away from a component with invalid data.

    https://angular.io/docs/ts/latest/api/router/index/CanDeactivate-interface.html

提交回复
热议问题