How to validate a form when the submit button is outside of this form, with angularJs?

后端 未结 4 1205
孤街浪徒
孤街浪徒 2021-02-08 11:47

I have a form element created with AngularJS with a submit button within it and I would like to put this button outside of this form. How can I do that with Angular and have my

4条回答
  •  抹茶落季
    2021-02-08 12:49

    If the submit button is outside of the form, then you can wrap your button and form with an ngForm (yes, ngForms can be nested). Give your ngForm a name so that you can handle the submit click and reference the form object by name in the same scope context

提交回复
热议问题