Angular form with ngModel in input

Hello,
I am new to ionic 2/3, prev. I have worked with ionic 1.
I was creating one screen of login.
for that, I create form and two input with ngModel. but that gives me the error.

If ngModel is used within a form tag, either the name attribute must be set or the form
control must be defined as ‘standalone’ in ngModelOptions.

i solved it by giving name to each ion-input, but i also want to validate input from controller side and use onSubmit property in form, use FormGroup and that angular forms provide.

So can anyone provide full documentation and example of angular form (ngForm).

I would recommend using reactive forms.

1 Like

Okay, i will check it.
one off-line question. i want to upload multipart image to REST API.

  1. user select one picture to upload
  2. image output need to be multipart, that i will map with API parameter with some extra params like name,email. and send push request

so how to achieve this.