Título navbar - Miga de pan
This commit is contained in:
parent
7db758690c
commit
f926c4a5b0
@ -11,18 +11,18 @@ import { UnidadInformacionComponent } from './pages/unidad-informacion/unidad-in
|
|||||||
|
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
{ path: 'login', component: LoginComponent },
|
{ path: 'login', component: LoginComponent },
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: LayoutComponent,
|
component: LayoutComponent,
|
||||||
children: [
|
children: [
|
||||||
{ path: '', redirectTo: 'inicio', pathMatch: 'full' },
|
{ path: '', redirectTo: 'inicio', pathMatch: 'full' },
|
||||||
{ path: 'inicio', component: HomeComponent },
|
{ path: 'inicio', component: HomeComponent, data: { title: 'Inicio' } },
|
||||||
{ path: 'unidad-concesiones', component: ConcesionesComponent },
|
{ path: 'unidad-concesiones', component: ConcesionesComponent, data: { title: 'Unidad de Concesiones' } },
|
||||||
{ path: 'ct-actualizacion', component: ActualizacionPdComponent },
|
{ path: 'ct-actualizacion', component: ActualizacionPdComponent, data: { title: 'Cronograma temporal por actualización de PD' } },
|
||||||
{ path: 'ct-ajuste', component: AjustePdComponent },
|
{ path: 'ct-ajuste', component: AjustePdComponent , data: { title: 'Cronograma temporal por ajuste de PD' } },
|
||||||
{ path: 'resumen', component: ResumenComponent },
|
{ path: 'resumen', component: ResumenComponent, data: { title: 'Resumen' } },
|
||||||
{ path: 'unidad-informacion', component: UnidadInformacionComponent },
|
{ path: 'unidad-informacion', component: UnidadInformacionComponent, data: { title: 'Unidad de Información' } },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{ path: '**', redirectTo: 'inicio' }
|
{ path: '**', redirectTo: 'inicio' }
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<!-- Page title and breadcrumb -->
|
<!-- Page title and breadcrumb -->
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="page-title">{{ pageTitle }}</div>
|
<div class="page-title tituloNavbar">{{ pageTitle }}</div>
|
||||||
<div class="breadcrumb-container">
|
<div class="breadcrumb-container">
|
||||||
<a routerLink="/dashboard" class="breadcrumb-link">Inicio</a>
|
<a routerLink="/dashboard" class="breadcrumb-link">Inicio</a>
|
||||||
<span class="breadcrumb-separator">/</span>
|
<span class="breadcrumb-separator">/</span>
|
||||||
|
|||||||
@ -2,6 +2,8 @@ import { Component, EventEmitter, Output } from '@angular/core';
|
|||||||
import { RouterLink } from '@angular/router';
|
import { RouterLink } from '@angular/router';
|
||||||
import { ButtonModule } from 'primeng/button';
|
import { ButtonModule } from 'primeng/button';
|
||||||
import { ConfirmationService } from 'primeng/api';
|
import { ConfirmationService } from 'primeng/api';
|
||||||
|
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
|
||||||
|
import { filter, map, mergeMap } from 'rxjs/operators';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-navbar',
|
selector: 'app-navbar',
|
||||||
@ -12,8 +14,23 @@ import { ConfirmationService } from 'primeng/api';
|
|||||||
})
|
})
|
||||||
export class NavbarComponent {
|
export class NavbarComponent {
|
||||||
@Output() sidebarToggle = new EventEmitter<void>();
|
@Output() sidebarToggle = new EventEmitter<void>();
|
||||||
pageTitle: string = 'Starter Page';
|
pageTitle: string = 'Starter Pages';
|
||||||
constructor(private confirmationService: ConfirmationService) {}
|
constructor(private confirmationService: ConfirmationService,private router: Router, private activatedRoute: ActivatedRoute) {
|
||||||
|
this.router.events.pipe(
|
||||||
|
filter(event => event instanceof NavigationEnd),
|
||||||
|
map(() => {
|
||||||
|
let route = this.activatedRoute;
|
||||||
|
while (route.firstChild) {
|
||||||
|
route = route.firstChild;
|
||||||
|
}
|
||||||
|
return route;
|
||||||
|
}),
|
||||||
|
mergeMap(route => route.data)
|
||||||
|
).subscribe(data => {
|
||||||
|
this.pageTitle = data['title'] || 'Sin título';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
toggleSidebar() {
|
toggleSidebar() {
|
||||||
this.sidebarToggle.emit();
|
this.sidebarToggle.emit();
|
||||||
@ -36,6 +53,6 @@ export class NavbarComponent {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,8 +47,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tituloTabla{
|
.tituloTabla, .tituloNavbar {
|
||||||
color: #002147;
|
color: #002147 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tablaAzul{
|
.tablaAzul{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user