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 112
112
"@angularclass/hmr-loader" : " ~3.0.2" ,
113
113
"@code.gov/api-client" : " ^0.1.1" ,
114
114
"@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 " ,
116
116
"@ngx-meta/core" : " ^0.4.0-rc.2" ,
117
117
"@types/jasminewd2" : " ^2.0.2" ,
118
118
"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' ;
2
2
import { Router , NavigationEnd } from '@angular/router' ;
3
3
4
4
import { SeoService } from '../../services/seo' ;
@@ -13,7 +13,7 @@ import * as SiteConfig from '../../../../config/code-gov-config.json';
13
13
styles : [ require ( './home.style.scss' ) ] ,
14
14
template : require ( './home.template.html' )
15
15
} )
16
- export class HomeComponent implements OnInit {
16
+ export class HomeComponent implements OnInit , AfterViewInit {
17
17
18
18
constructor (
19
19
public stateService : StateService ,
@@ -28,14 +28,17 @@ export class HomeComponent implements OnInit {
28
28
) ;
29
29
}
30
30
31
- ngOnInit ( ) {
31
+ ngOnInit ( ) : void {
32
32
// 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 ) ;
39
42
}
40
43
41
44
scrollToAbout ( ) {
You can’t perform that action at this time.
0 commit comments