Project

General

Profile

« Previous | Next » 

Revision 59816

[Library|Trunk]

code clean up:
-remove app.* files from library
-remove unused imports, code, files (Old search pages for results, dataproviders, map search page, etc)
-remove Freeguard from modules
-unsubscribe all subscriptions
-Services: configuration, isvocabularies, user management: unsubscribe from app component or the component that uses them (clearSubscriptions())
-Fetchers: unsubscribe from the component that uses them (clearSubscriptions())

View differences:

searchFilter.component.ts
3 3
  Input,
4 4
  Output,
5 5
  EventEmitter,
6
  ViewChild,
7
  ElementRef,
8 6
  OnInit,
9 7
  OnChanges,
10 8
  SimpleChanges
11 9
} from '@angular/core';
12 10
import { Filter, Value} from './searchHelperClasses.class';
13
import {ActivatedRoute, NavigationStart, Router} from "@angular/router";
11
import {ActivatedRoute, Router} from "@angular/router";
14 12
import {properties} from "../../../../environments/environment";
15 13
import 'rxjs/add/operator/filter';
16 14
@Component({
......
38 36
  queryParams = {};
39 37
  @Input() actionRoute:boolean = false;
40 38
  @Input() quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string };
39
  sub;
41 40
  public isOpen:boolean=false;
42 41

  
43 42
    constructor (private _router: Router, private route: ActivatedRoute) {
44 43
    }
45

  
44
  ngOnDestroy() {
45
    if(this.sub){
46
      this.sub.unsubscribe();
47
    }
48
  }
46 49
    ngOnInit() {
47
      this.route.queryParams.subscribe(params => {
50
      this.sub = this.route.queryParams.subscribe(params => {
48 51
        this.queryParams = Object.assign({}, params);
49 52
      });
50 53
      this.filter.values = this.filter.values.filter(value => !value.name.toLowerCase().includes('unknown') && !value.name.toLowerCase().includes('not available'));

Also available in: Unified diff