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.
-
Login page is hard to customizing. Create new one instead. – Maximi Nov 05 '17 at 16:08
-
thanks@Maximi , Am trying to create a new one – vinu prasad Nov 06 '17 at 05:28
-
Is there any idea to hide the nb-menu in ngx admin for the new login page ? – vinu prasad Nov 06 '17 at 07:08
-
Actually I found the template in NPM. Only the way to customise it is change CSS. Little confused for me also, but this is life... – Maximi Nov 06 '17 at 16:25
-
ok.Thanks a lot @Maximi – vinu prasad Nov 07 '17 at 06:40
3 Answers
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
- in file
core.module.tschange following imports:
import { NbAuthModule, NbDummyAuthStrategy } from '@nebular/auth';
to
import { NbAuthModule, NbDummyAuthStrategy } from '../@theme/components/auth'; // '@nebular/auth';
- in file
app-routing.module.tschange following imports
import {
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
- 321
- 3
- 7
- 161
- 5
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
- 4,031
- 2
- 40
- 66
-
-
Dhaval shah , I actually implemented on this https://github.com/akveo/ngx-admin , repo of current project is not available – TAHA SULTAN TEMURI Dec 18 '20 at 06:16
I will recommend you to use Ngx-admin existing login page because it is very easy to customize. You can simply set it by setting the endpoint and you can also modify the existing by copying the source code from ngx-admin documentation.
- 1,280
- 13
- 24

