1575286070
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.
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
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.
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.html
file 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;
}
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.
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>
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>
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
1610191977
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.
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
1609902140
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.
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
1610191977
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.
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
1608042207
#registration form #login form #sign in form #responsive login #html login page
1600307723
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.
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