How to Create Login and Registration Form with Angular 8 using Ionic UI

In this Ionic 4 tutorial, we will learn how to create a responsive login and registration form with Angular 8 using Ionic UI components.

We have created authentication tutorials on the following platforms Angular, Firebase, Node, Express and MongoDB.
Creating a login and registration form is merely effortless all thanks goes to the Ionic’s built-in UI components. Ionic makes frontend developers job easy and short to build the login UI.

Our Ionic 4 Angular 8 Form app will have login and registration pages so we will also learn to implement Ionic 4 routing to navigate between components.

Install Ionic Angular Project

To get started with Login & Registration UI, Install the blank Ionic/Angular project by running the following command.

ionic start ionic-form-ui blank --type=angular

Get inside the project directory.

cd ionic-form-ui

Install the lab mode by running the below command.

npm i @ionic/lab --save-dev

Run the command to start your Ionic app.

ionic serve -l

Ionic 4 Forms Project

Generate Components

To create the Ionic form we need to generate components for Login, Sign Up, and Forgot Password pages. In Ionic we call pages to components, run the following command to create the pages.

ng generate page login
ng generate page registration
ng generate page forgot-password

We have generated the following components which you can see in your IDE or text-editor as well.

Generate Ionic Components

Configure Ionic Routing

In the home page we will create the log-in and sign-up button, clicking on these button user will navigate to their respective page. In the next step, we will learn how to enable the routing in Ionic 4 app.

import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';

const routes: Routes = [
  { path: '', redirectTo: 'home', pathMatch: 'full' },
  { path: 'home', loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)},
  {
    path: 'login',
    loadChildren: () => import('./login/login.module').then( m => m.LoginPageModule)
  },
  {
    path: 'registration',
    loadChildren: () => import('./registration/registration.module').then( m => m.RegistrationPageModule)
  },
  {
    path: 'forgot-password',
    loadChildren: () => import('./forgot-password/forgot-password.module').then( m => m.ForgotPasswordPageModule)
  },
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  ],
  exports: [RouterModule]
})

export class AppRoutingModule { }

Add Angular [routerLink]="['...']" directive in Ionic buttons to enable the navigation between components. Open home.page.htmlfile and add the following code.

<ion-header>
  <ion-toolbar>
    <ion-title>
      Ionic 4 Form
    </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content class="auth-form">
  <ion-grid>
    <ion-row>
      <ion-col align-self-center>
        <ion-button [routerLink]="['/registration']" expand="block" color="primary">Register</ion-button>

        <span class="divider line one-line">or</span>

        <span class="already">Already a user?</span>

        <ion-button [routerLink]="['/login']" expand="block" color="danger">Sign In</ion-button>
      </ion-col>
    </ion-row>
  </ion-grid>
</ion-content>

Open home.page.scss file to add the CSS style for the home screen.


.divider {
    display: flex;

    &:before,
    &:after {
      content: "";
      flex: 1;
    }
}

.line {
    align-items: center;
    margin: 1em -1em;
    color: #cccccc;

    &:before,
    &:after {
      height: 1px;
      margin: 0 1em;
    }
} 

.one-line {
    &:before,
    &:after {
       background: #cccccc;
    }
}

.auth-form ion-grid,
.auth-form ion-row {
    height: 100%;
    justify-content: center;
}

.already {
    display: block;
    text-align: center;
    padding-bottom: 10px;
}

Ionic 4 login UI

Create Ionic 4 Login UI Form

To create login form template we need to use the Ionic UI components such as ion-input and ion-button.

Open login.page.html file and paste the following code in it.

<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-back-button></ion-back-button>
    </ion-buttons>
    <ion-title>Log In</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <form>
    <ion-item lines="full">
      <ion-label position="floating">Email</ion-label>
      <ion-input type="text" required></ion-input>
    </ion-item>

    <ion-item lines="full">
      <ion-label position="floating">Password</ion-label>
      <ion-input type="password" required></ion-input>
    </ion-item>

    <ion-row>
      <ion-col>
        <ion-button type="submit" color="danger" expand="block">Sign In</ion-button>
        <a [routerLink]="['/forgot-password']" class="small-text">Forgot Password?</a>
      </ion-col>
    </ion-row>
  </form>
</ion-content>

To go back to the previous page we used the ion-back-button component, we build the login form in Ionic 4 / Angular using input, button components.

Ionic 4 Login Form UI

Create Register Form Page

To create a sign up form we will add the first name, last name, email and password field in the Ionic’s register page and the open the registration.page.html file and add the following code in it.

<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-back-button></ion-back-button>
    </ion-buttons>
    <ion-title>Register</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <form>
    <ion-item lines="full">
      <ion-label position="floating">First name</ion-label>
      <ion-input type="text" required></ion-input>
    </ion-item>

    <ion-item lines="full">
      <ion-label position="floating">Last name</ion-label>
      <ion-input type="text" required></ion-input>
    </ion-item>

    <ion-item lines="full">
      <ion-label position="floating">Email</ion-label>
      <ion-input type="text" required></ion-input>
    </ion-item>

    <ion-item lines="full">
      <ion-label position="floating">Password</ion-label>
      <ion-input type="password" required></ion-input>
    </ion-item>

    <ion-row>
      <ion-col>
        <ion-button type="submit" color="danger" expand="block">Sign Up</ion-button>
      </ion-col>
    </ion-row>
  </form>
</ion-content>

Ionic 4 Sign up form

Create Forgot Password

Next, we will create a forgot password form in the Ionic page. If a user forgets his or her password then he will enter his email address and will get instruction on his registered email id to create a new password.

Open the forgot-password.page.html file and add the following code inside of it.

<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-back-button></ion-back-button>
    </ion-buttons>
    <ion-title>Reset Your Password</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <form>
    <ion-item lines="full">
      <ion-label position="floating">Email</ion-label>
      <ion-input type="email" required></ion-input>
    </ion-item>

    <ion-row>
      <ion-col>
        <ion-button type="submit" color="danger" expand="block">Send</ion-button>
      </ion-col>
    </ion-row>

    <small>
      Please provide the username or email address that you used when you signed
      up for your Evernote account.
    </small>
  </form>
</ion-content>

Forgot Password in Ionic

Conclusion

Thats it for now finally we have completed Ionic 4 Login UI tutorial and learned how to create basic sign-in and sign-up form in Ionic / Angular app. You can get the completed code of this project on this Git repo.

#Angular #Ionic

What is GEEK

Buddha Community

How to Create Login and Registration Form with Angular 8 using Ionic UI

I am Developer

1610191977

Angular 11 Google Social Login Example

Angular 9/10/11 social login with google using angularx-social-login library example. In this tutorial, i will show you step by step on how to implement google social login in angular 11 app.

And also, this tutorial will show you How to login into Angular 10/11 application with google using angularx-social-login library in angular 11 app.

Google Login Integration In Angular 11 App

  • Step 1 - Create New Angular App
  • Step 2 - Install Social Login Library
  • Step 3 - Add Code on App.Module.ts File
  • Step 4 - Add Code on View File
  • Step 5 - Add Code On App.Component ts File
  • Step 6 - Start the Angular Google Login App

https://www.tutsmake.com/angular-11-google-social-login-example/

#angular 11 google login #angular 11 social-login example #login with google button angular 8/9/10/11 #angular 10/11 login with google #angular 10 social google login #angular social login google

I am Developer

1609902140

Angular 11 Facebook Social Login Example

Angular 9/10/11 social login with facebook using angularx-social-login library example. In this tutorial, i would love to show you how to integrate facebook social login in angular 11 app.

And you will learn how to add facebook social login button with angular reactive login form.

Angular 11 Social Login with Facebook Tutorial

  • Step 1 - Create New Angular App
  • Step 2 - Install Social Login Library
  • Step 3 - Add Code on App.Module.ts File
  • Step 4 - Add Code on View File
  • Step 5 - Add Code On App.Component ts File
  • Step 6 - Start the Angular Facebook Login App

https://www.tutsmake.com/angular-11-facebook-login-tutorial-example/

#angular 11 facebook login #angular 11 social-login example #login with facebook button angular 8/9/10/11 #angular 10/11 login with facebook #angular 10 social facebook login #angular social login facebook

I am Developer

1610191977

Angular 11 Google Social Login Example Tutorial

Angular 9/10/11 social login with google using angularx-social-login library example. In this tutorial, i will show you step by step on how to implement google social login in angular 11 app.

And also, this tutorial will show you How to login into Angular 10/11 application with google using angularx-social-login library in angular 11 app.

Google Login Integration In Angular 11 App

  • Step 1 - Create New Angular App
  • Step 2 - Install Social Login Library
  • Step 3 - Add Code on App.Module.ts File
  • Step 4 - Add Code on View File
  • Step 5 - Add Code On App.Component ts File
  • Step 6 - Start the Angular Google Login App

https://www.tutsmake.com/angular-11-google-social-login-example/

#angular 11 google login #angular 11 social-login example #login with google button angular 8/9/10/11 #angular 10/11 login with google #angular 10 social google login #angular social login google

wp codevo

wp codevo

1608042207

Responsive Login & Registration Form Using HTML & CSS & JS

https://youtu.be/4XRZWOAf-hQ

#registration form #login form #sign in form #responsive login #html login page

Yogi Gurjar

1600307723

Laravel 8 Form Example Tutorial - Complete Guide

Laravel 8 form example. In this tutorial, i would love to show you how to create form in laravel. And how to insert data into database using form in laravel 8.

How to Submit Form Data into Database in Laravel 8

  1. Step 1 – Install Laravel 8 Application
  2. Step 2 – Configuring Database using Env File
  3. Step 3 – Create Model & Migration File For Add Blog Post Form
  4. Step 4 – Create Routes
  5. Step 5 – Creating Controller
  6. Step 6 – Create Blade File For Add Blog Post Form
  7. Step 7 – Start Development Server
  8. Step 8 – Run Laravel 8 Form App On Browser

https://laratutorials.com/laravel-8-form-example-tutorial/

#insert form data into database using laravel #laravel bootstrap form #laravel post forms #laravel 8 form tutorial #laravel 8 form example #laravel 8 form submit tutorial