I have created a new module called as login-page. I want navigate to that module from app.component.html
Then link is given through a button in app.component.html is as follows:
<a routerLink="/login-page">
<button class="ms-Button" id="btn-1">
<span class="ms-Button-label" id="Sign_up_btn">SignUp</span>
</button>
</a>
The app.modules.ts file looks like this:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { FlexLayoutModule } from '@angular/flex-layout';
import { LoginPageComponent } from './login-page/login-page.component';
import { RouterModule, Routes } from '@angular/router';
import { SignupFormComponent } from './signup-form/signup- form.component';
@NgModule({
declarations: [
AppComponent,
LoginPageComponent,
SignupFormComponent
],
imports: [
BrowserModule,
FlexLayoutModule,
RouterModule.forRoot([
{ path: 'login-page', component: LoginPageComponent },
{ path: 'signup-form', component: SignupFormComponent }
])
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
It's navigating fine, but its content(login-page.component.html) is displaying in same page(app.component.html). I want it to in display separate page. How can I achieve this?