Reputation: 978
I would like my landing page URL to be myapp.com.
Currently, inside src/index.html I have
<head>
<base href="/">
</head>
In app.component.html I have
<router-outlet></router-outlet>
In app.module.ts I have
const appRoutes: Routes = [
{path: 'home', component: HomeComponent},
{path: '', redirectTo: '/home', pathMatch: 'full'}
];
I don't want to redirect myapp.com to myapp.com/home, I want myapp.com to show my landing page and I would like myapp.com/feature to show another page.
Upvotes: 0
Views: 424
Reputation: 2862
If you do not want myapp.com to redirect to nyapp.com/home why are you telling it to do so?
get rid of this line:
{path: '', redirectTo: '/home', pathMatch: 'full'}
So your routes would look like this:
const appRoutes: Routes = [
{path: '', component: HomeComponent},
{path: 'feature', component: FeatureComponent}
];
Upvotes: 1
Reputation: 159
Changing your routing to have the route to your component be: {path: '', component: HomeComponent, pathMatch: 'full'}
and get rid of the route performing a redirect should do just that.
Upvotes: 1