import {AfterViewInit, OnInit} from "@angular/core";
import {Component} from "@angular/core";
import {Router, ActivatedRoute} from "@angular/router";
import {SearchService} from "../app.search.service";

@Component({
  selector: 'comming-soon',
  templateUrl: './comingSoon.component.html'
})
export class ComingSoonComponent implements OnInit, AfterViewInit {

  routeParamsSub: any;

  constructor(private router:Router, private searchService:SearchService, private route: ActivatedRoute) {

  }

  ngOnInit()
  {
    this.routeParamsSub = this.route.params.subscribe(params => {
      this.searchService.updateSearchParameters(undefined, {}, true);
    });
  }

  getName()
  {
    if(this.router.isActive('guides', true))
      return "guides";
    else if(this.router.isActive('policies', true))
      return "policies";
    else if(this.router.isActive('showcase', true))
      return "research projects to showcase";
    return "";
  }

  ngAfterViewInit() {
    window.scrollTo(0, 0);
  }

  ngOnDestroy() {
    this.routeParamsSub.unsubscribe();
  }
}

import {AfterViewInit} from "@angular/core";
import {Component} from "@angular/core";
import {Router} from "@angular/router";

@Component({
  selector: 'comming-soon',
  templateUrl: './comingSoon.component.html'
})
export class ComingSoonComponent implements AfterViewInit
{

  constructor(private router:Router) {

  }

  getName()
  {
    if(this.router.isActive('guides', true))
      return "guides";
    else if(this.router.isActive('policies', true))
      return "policies";
    else if(this.router.isActive('showcase', true))
      return "research projects to showcase";
    return "";
  }

  ngAfterViewInit() {
    window.scrollTo(0, 0);
  }
}

--- 
+++ 
@@ -1,16 +1,25 @@
-import {AfterViewInit} from "@angular/core";
+import {AfterViewInit, OnInit} from "@angular/core";
 import {Component} from "@angular/core";
-import {Router} from "@angular/router";
+import {Router, ActivatedRoute} from "@angular/router";
+import {SearchService} from "../app.search.service";
 
 @Component({
   selector: 'comming-soon',
   templateUrl: './comingSoon.component.html'
 })
-export class ComingSoonComponent implements AfterViewInit
-{
+export class ComingSoonComponent implements OnInit, AfterViewInit {
 
-  constructor(private router:Router) {
+  routeParamsSub: any;
 
+  constructor(private router:Router, private searchService:SearchService, private route: ActivatedRoute) {
+
+  }
+
+  ngOnInit()
+  {
+    this.routeParamsSub = this.route.params.subscribe(params => {
+      this.searchService.updateSearchParameters(undefined, {}, true);
+    });
   }
 
   getName()
@@ -27,4 +36,8 @@
   ngAfterViewInit() {
     window.scrollTo(0, 0);
   }
+
+  ngOnDestroy() {
+    this.routeParamsSub.unsubscribe();
+  }
 }
Update search parameters so that search values reset.
