accessibility page heading

This commit is contained in:
pionnegru
2019-10-17 13:43:47 +03:00
parent 9fd47d3186
commit b633d85352
3 changed files with 14 additions and 0 deletions
+1
View File
@@ -1 +1,2 @@
<h1 class="sr-only">{{ pageHeading | translate }}</h1>
<router-outlet></router-outlet>
+11
View File
@@ -1,4 +1,15 @@
:host {
display: flex;
flex: 1;
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
}
+2
View File
@@ -59,6 +59,7 @@ import { INITIAL_APP_STATE } from './store/initial-state';
})
export class AppComponent implements OnInit, OnDestroy {
onDestroy$: Subject<boolean> = new Subject<boolean>();
pageHeading = '';
constructor(
private route: ActivatedRoute,
@@ -111,6 +112,7 @@ export class AppComponent implements OnInit, OnDestroy {
const snapshot: any = event.snapshot || {};
const data: any = snapshot.data || {};
this.pageHeading = data.title || '';
pageTitle.setTitle(data.title || '');
this.store.dispatch(new SetCurrentUrlAction(router.url));
});