[英]Set dynamic PWA base routing in Angular 8
I am developing an Angular PWA App.我正在开发一个 Angular PWA 应用程序。 Below is my requirements.
下面是我的要求。
Example: I have https://localhost.com website.示例:我有https://localhost.com网站。 So my PWA is taking me to this url after showing me the splash screen.
所以我的 PWA 在向我展示了初始屏幕后将我带到了这个 url。
According to my requirements it should directly open https://localhost.com/user/login .根据我的要求,它应该直接打开https://localhost.com/user/login 。
How can i achieve this.我怎样才能做到这一点。 I am attaching my manifest file.
我附上我的清单文件。
{
"name": "buisness-card",
"short_name": "buisness-card",
"theme_color": "#1976d2",
"background_color": "#fafafa",
"display": "standalone",
"scope": "./user/login",
"start_url": "./",
"icons": [
{
"src": "assets/icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-96x96.png",
"sizes": "96x96",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-384x384.png",
"sizes": "384x384",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable any"
}
]
}
Please post the content of your app-routing.module.ts.请发布您的 app-routing.module.ts 的内容。
If you need domain.com to redirect to domain.com/user/login all you need to do is a redirectTo:如果您需要 domain.com 重定向到 domain.com/user/login 您需要做的就是重定向到:
{ path: '<yourPath>', redirectTo: '<routeYouWantToRedirectTo>', pathMatch: 'full' }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.