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:

portal-search-result.component.ts
6 6
import {Router} from "@angular/router";
7 7
import {LocalStorageService} from "../../services/localStorage.service";
8 8
import {Stakeholder, StakeholderInfo, Visibility} from "../../monitor/entities/stakeholder";
9
import {Subscriber} from "rxjs";
9 10

  
10 11
@Component({
11 12
  selector: 'portal-search-result',
......
34 35
  public errorMessage: string = "No results found";
35 36
  public selected: CommunityInfo & Stakeholder;
36 37
  public directLink: boolean = true;
38
  sub;
37 39
  
38
  
39 40
  constructor(private router: Router,
40 41
              private localStorageService: LocalStorageService) {
41 42
  }
42
  
43
  ngOnDestroy() {
44
    if(this.sub){
45
      this.sub.unsubscribe();
46
    }
47
  }
43 48
  ngOnInit() {
44
    this.localStorageService.get().subscribe(value => {
49
    this.sub = this.localStorageService.get().subscribe(value => {
45 50
      this.directLink = value;
46 51
    });
47 52
  }

Also available in: Unified diff