[英]how to make login page as default page with angular
I am a beginner in Angular, and I work on a template with Nebular . 我是Angular的初学者,并且使用Nebular制作模板。 Our authentication page (login) does not exist in the folder src, but in the folder node_modules, and I want to make the login page appears first when I open my interface, but I could not achive it. 我们的身份验证页面(登录)不存在于src文件夹中,而是存在于node_modules文件夹中,我想使登录页面在打开界面时首先出现,但无法实现。 When I try to generate a new login component in the src folder, I found many problems that I didn't understand. 当我尝试在src文件夹中生成新的登录组件时,发现了许多我不理解的问题。
In src/app/app-routing.module.ts, 在src / app / app-routing.module.ts中,
change 更改
{ path: '', redirectTo: 'pages', pathMatch: 'full' },`
in to 进入
{ path: '', redirectTo: 'auth', pathMatch: 'full' },
Edit the routing file of your apps app.routes.ts
. 编辑应用程序app.routes.ts
的路由文件。
export const AppRoutes: Routes = [
{
path: '',
redirectTo: '/your-login-url',
pathMatch: 'full'
}
]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.