This repository was archived by the owner on Aug 5, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 112112 "@angularclass/hmr-loader" : " ~3.0.2" ,
113113 "@code.gov/api-client" : " ^0.1.1" ,
114114 "@code.gov/code-gov-font" : " ^0.5.0" ,
115- "@code.gov/code-gov-style" : " ^1.0.1 " ,
115+ "@code.gov/code-gov-style" : " ^1.0.2 " ,
116116 "@ngx-meta/core" : " ^0.4.0-rc.2" ,
117117 "@types/jasminewd2" : " ^2.0.2" ,
118118 "angulartics2" : " 1.4.3" ,
Original file line number Diff line number Diff line change 1- import { Component , OnInit } from '@angular/core' ;
1+ import { Component , OnInit , AfterViewInit } from '@angular/core' ;
22import { Router , NavigationEnd } from '@angular/router' ;
33
44import { SeoService } from '../../services/seo' ;
@@ -13,7 +13,7 @@ import * as SiteConfig from '../../../../config/code-gov-config.json';
1313 styles : [ require ( './home.style.scss' ) ] ,
1414 template : require ( './home.template.html' )
1515} )
16- export class HomeComponent implements OnInit {
16+ export class HomeComponent implements OnInit , AfterViewInit {
1717
1818 constructor (
1919 public stateService : StateService ,
@@ -28,14 +28,17 @@ export class HomeComponent implements OnInit {
2828 ) ;
2929 }
3030
31- ngOnInit ( ) {
31+ ngOnInit ( ) : void {
3232 // fixes weird issue where would start on home page scrolled down somewhat
33- this . router . events . subscribe ( ( evt ) => {
34- if ( ! ( evt instanceof NavigationEnd ) ) {
35- return ;
36- }
37- window . scrollTo ( 0 , 0 ) ;
38- } ) ;
33+ window . scrollTo ( 0 , 0 ) ;
34+ }
35+
36+ ngAfterViewInit ( ) : void {
37+ /*
38+ fixes weird issue where would start on home page scrolled down somewhat
39+ This is called each time the use switches to the home page.
40+ */
41+ window . scrollTo ( 0 , 0 ) ;
3942 }
4043
4144 scrollToAbout ( ) {
You can’t perform that action at this time.
0 commit comments