import { ChangeDetectionStrategy , ChangeDetectorRef , Component , ElementRef , ViewChild , } from '@angular/core' ; import { Router } from '@angular/router' ; import { ConfigsService } from '../../../common/services/configs.service' ; @ Component ( { selector : 'm-pay__marketing' , templateUrl : 'marketing.component.html' , changeDetection : ChangeDetectionStrategy . OnPush , } ) export class PayMarketingComponent { readonly cdnAssetsUrl : string ; @ ViewChild ( 'topAnchor' ) readonly topAnchor : ElementRef ; constructor ( protected router , protected cd , configs ) { this . cdnAssetsUrl = configs . get ( 'cdn_assets_url' ) ; } scrollToTop ( ) { if ( this . topAnchor . nativeElement ) { this . topAnchor . nativeElement . scrollIntoView ( { behavior : 'smooth' , block : 'start' , inline : 'nearest' , } ) ; } } action ( ) { this . router . navigate ( [ '/wallet' ] ) ; } detectChanges ( ) { this . cd . markForCheck ( ) ; this . cd . detectChanges ( ) ; } }