Form validation

here is my home.html file :smile:

<ion-header>
    <ion-navbar>
      <ion-title text-center="true" class="title">Ionic 2 how to validae Form</ion-title>
    </ion-navbar>
</ion-header>

<ion-content class="home">
     <form (submit)="doLogin">
  <div class="form">
    <div class="inside-form">
        <p class="alert"></p>
      <ion-item>
      <ion-label floating>Username</ion-label>
  <ion-input type="text" required size="50"></ion-input>
      </ion-item>
      <br><br>
      <ion-item>
        <ion-label floating>Password</ion-label>
  <ion-input  type="password" required size="50"></ion-input>
      </ion-item>
      <br><br>
  <button type="submit" (click)="click()">Log in</button>
    </div>
  </div>
</form>
</ion-content>

And here is home.ts file :blush:

import {Component} from '@angular/core';
import { FormBuilder } from '@angular/common'

@Component({
  templateUrl: 'build/pages/home/home.html'
})
export class HomePage {
}

I’m a new learning ionic 2 . Please have me validate this form i create i don’t now how to do is , if somebody now pleas coment . Thank so must !!.
love all you guys!.

there are two types of building forms in angular 2:

1 Like

thank you , your answer help me a lot of trolble , that blog is awsom , i have many exprerience when i read that, thank so must

1 Like

did you have e example buliding form in ionic 2 , if have please so me , thank