I am using angular4. I want to customize the login page in the ngx-admin. Is there any solution? Or it is good to create a new login page in ngx-admin instead of customizing the existing one.
On the left-hand admin panel, click on Theme My Login and select the General option. Here you will find links to the 5 login-related pages that the plugin automatically generates. You will also find a few settings to customize those pages, but they are very simple. The first setting is the login type.
According to this link and this issue The following changes can be made to customize/ extend the existing the auth-pages/components in ngx-admin (without the npm dependency)
First Copy all source files from this repository folder to
'theme/components/auth'
of your project
core.module.ts
change following imports: import { NbAuthModule, NbDummyAuthStrategy } from '@nebular/auth';
to
import { NbAuthModule, NbDummyAuthStrategy } from '../@theme/components/auth'; // '@nebular/auth';
app-routing.module.ts
change following importsimport {
NbAuthComponent,
NbLoginComponent,
NbLogoutComponent,
NbRegisterComponent,
NbRequestPasswordComponent,
NbResetPasswordComponent,
} from '@nebular/auth';
to
import {
NbAuthComponent,
NbLoginComponent,
NbLogoutComponent,
NbRegisterComponent,
NbRequestPasswordComponent,
NbResetPasswordComponent,
} from './@theme/components/auth'; //'@nebular/auth'
4.in file theme.module.ts
add following imports
// this line in import part of the file
import {NbAuthModule} from './components/auth';
import {NbPasswordAuthStrategy} from "./components/auth/strategies";
// inside of const NB_THEME_PROVIDERS
NbAuthModule.forRoot({
providers: {
email: {
service: NbPasswordAuthStrategy,
config: {},
}
}
}).providers,
References
In order to use customize login page you just have to do following steps.
Note:
I have created login component inside pages folder.
Version
Your global Angular CLI version (8.3.9) is greater than your local version (8.0.2). The local Angular CLI version is used.
Step#1
Replace route component with your component name like this inside app-routing.module.ts
path: 'auth',
component: NbAuthComponent,
children: [
{
path: '',
component: LoginComponent,
},
{
path: 'login',
component: LoginComponent,
},
Step#2
Import component in theme.modules.ts
located inside /src/app/@theme
import {LoginComponent} from '../../app/pages/login/login.component'
const COMPONENTS = [
HeaderComponent,
FooterComponent,
SearchInputComponent,
TinyMCEComponent,
OneColumnLayoutComponent,
ThreeColumnsLayoutComponent,
TwoColumnsLayoutComponent,
LoginComponent // HERE
];
Step#3
Put component inside declaration of pages.module.ts
declarations: [
PagesComponent,
LoginComponent,
],
Results
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With