1
I set my files all correctly I think, but when I click on the button
This is the router configuration page I put the signup in the array
app-route.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { SignupComponent } from './signup/signup.component';
const routes: Routes = [
{path: 'signup', component: SignupComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
This is the navbar I used to call the signup route
Nav.component.html
<div class="wrapper header" id="home">
<nav>
<div class="menu-icon">
<i class="fa fa-bars fa-2x"></i>
</div>
<div class="logo">
<a class="scroll" href="#home">SHOP</a>
</div>
<div class="menu">
<ul>
<li><a class="scroll" href="#guitars">Guitars</a></li>
<li><a class="scroll" href="#contact">About</a></li>
<li><a class="scroll" routerLink="/signup" routerLinkActive="active">SignUp</a></li>
</ul>
</div>
</nav>
<h3 class="h3style">A guitarra do seus sonhos <br> está aqui</h3>
</div>
And this is my page I use to call the selectors
<app-nav></app-nav>
<app-products></app-products>
<app-subscribe></app-subscribe>
<app-contact></app-contact>
<app-footer></app-footer>
<router-outlet></router-outlet>
Only thing that happens when I click the signup on the navbar is to add the page I want below the page I want to leave when I click the signup someone knows what I have to do ?
Which page do you want to exit ? Apparently you only have one page that loads in the Komponent app
router-outlet
, thesignup
, then no other Component is destroyed when thesignup
is initiated.– Victor Henrique