简体   繁体   English

链接到角度重定向到应用程序的外部URL

[英]Link to external url in angular redirects to application

Might be a simple question but I'm new to Angular. 可能是一个简单的问题,但我是Angular的新手。

I've set my routing setup already in the navbar, but I have a link that links to an external url, and when I click on it, it redirects me back to the application, not even in the home path ( HomeComponent is missing ) 我已经在导航栏中设置了路由设置,但是我有一个链接到外部URL的链接,当我单击它时,它会将我重定向到应用程序,甚至不重定向到主路径(缺少HomeComponent)。

The link looks like this : 链接看起来像这样:

 <a href="www.stackoverflow.com" target="_blank">

Here's my routing paths : 这是我的路由路径:

const routes: Routes = [
    { path: '', component: HomeComponent },
    { path: 'a-propos', component: AProposComponent },
    { path: 'savoir', component: SavoirComponent },
    { path: 'diplomes', component: DiplomesComponent },
    { path: 'expérience', component: ExperienceComponent },
    { path: 'portfolio', component: PortfolioComponent },
    { path: 'contact', component: ContactComponent },
];

在URL之前使用http://或https://尝试一下

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM