Creating a Login Page Using the 'ace-login-form' Component

From AgileApps Support Wiki
Revision as of 09:11, 7 February 2023 by Wikieditor (talk | contribs) (Created page with "You can create a custom login page by using '''''ace-login-form''''' component available in ace-lib. ===Prerequisites=== Create an angular CUI template app by following the i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

You can create a custom login page by using ace-login-form component available in ace-lib.

Prerequisites

Create an angular CUI template app by following the instructions present in the Creating an Angular Project for the CUI Template page.

Steps

If the Angular App is created as per the above guidelines, use the following Angular CLI command to create a login page and login component in the application.

1. Navigate to the hello-cui App directory and run the following command to create a login module inside the app: ng generate module login --route login --module app.module
2. Open the newly created login.component.html and paste the following login component tag into it.
<ace-login-form css-classlist="ace-bg-white"></ace-login-form>

Notepad.png

Note: Add additional HTML tags outside the above tag and CSS classes if required to beautify and align the login component.

3. Handle the loginSuccess event by performing the following changes to the login.component.html and login.component.ts:
login.component.html

Authentication Required

       <ace-login-form css-classlist="ace-bg-white" (loginSuccess)="loginSuccessHandler($event)"></ace-login-form>


login.component.ts
import { Component, OnInit } from '@angular/core'; @Component({

selector: ‘app-login’,

templateUrl: ‘./login.component.html’,

styleUrls: [‘./login.component.css’]

})

export class LoginComponent implements OnInit {


constructor() { }


loginSuccessHandler(event) {

//Handle Post login logic here.

const loggedInUserInfo = event.detail;

console.log(‘login Success’, loggedInUserInfo);


}

ngOnInit() {

}