1
I am making an application using angular 7 with angular/cli, but I find myself in a problem, I finished my login screen and I want to redirect to Dashboard;
But I find where the router-outlet opens the file inside the app component, I wanted to know a way to open another html page, even if it was another module.
<div class="row">
<!-- divisão das colunas -->
<div class="col-md-4">
<!-- seletor de idiomas -->
<div class="dropdown" style="float:right">
<button id="btn-SelecaoIdioma" type="button"
class="btn btn-link dropdown-toggle default-link-login login-link-idioma" data-toggle="dropdown">
Português (Brasil)
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenu2" style="font-size: 14px;">
<button class="dropdown-item" type="button"><a href="/Account/Language/en-US">English (United
States)</a></button>
<button class="dropdown-item" type="button"><a href="/Account/Language/es">Español</a></button>
<button class="dropdown-item active" type="button"><a href="/Account/Language/pt-BR">Português
(Brasil)</a></button>
</div>
</div>
<!-- div da imagem -->
<div id="login-logo" >
<img src="../assets/Images/Logo-solucao.png"
class="img-logo-login img-responsive">
</div>
<router-outlet></router-outlet>
<footer class="alinhar-footer" id="footer-login">
<div class="justify-content-center">
<!-- linha de layout -->
<hr class="my-3">
<!-- acesso por credenciais de terceiros -->
<div>
<p class="text-center">Ou use suas Credenciais </p>
</div>
<div class="row-social justify-content-center">
<div class="col-auto text-center">
<img id="img-Windows" class="l-social" src="../assets/Images/win.png"></div>
<div class="col-auto text-center">
<img id="img-Google" class="l-social" src="../assets/Images/google.png"></div>
<div class="col-auto text-center">
<img id="img-Facebook" class="l-social" src="../assets/Images/face.png"></div>
<div class="col-auto text-center">
<img id="img-Linkedin" class="l-social" src="../assets/Images/linkedin.png"></div>
</div>
</div>
<!-- area comercial da pagina de login -->
<p id="paragrafo-inicio" >
Faça como diversos profissionais da área, torne-se ! <br>
<a href="#" target="_blank" class="default-link">Fale com os nossos consultores.</a>
</p>
<a class="default-font-text12-login">© - 1.0.0</a> |
<a href="#" target="_blank" class="default-font-text12-login">Sobre o Sistema</a> |
<a href="#" target="_blank" class="default-font-text12-login">Contato</a>
</footer>
</div>
<div class="col-md-8" id="login-page">
</div>
</div>
routing-module
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { FormLoginComponent } from './form-login/form-login.component';
import { FormRecuperarSenhaComponent } from './form-recuperar-senha/form-recuperar-senha.component';
import { FormPrincipalComponent } from './form-principal/form-principal.component';
const routes: Routes = [
{path:'',component: FormLoginComponent},
{path:'form-recuperar-senha',component: FormRecuperarSenhaComponent},
{path:'form-principal',component: FormPrincipalComponent}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
I understood, but he always click on the router-outlet, in your case the menu was fixed correct? and he changes the content? i wanted something similar to html window.Location.
– Alexandre Nobre
Yes, the menu is always fixed at the top, you can change components that always stay fixed.
– Edward Ramos
I edited the answer and added a component as an example
– Edward Ramos