Project

General

Profile

« Previous | Next » 

Revision 56072

[Aggregator|Trunk]

Get custom filter from aggregators class
use one aggregator as the default one

View differences:

searchOrps.component.ts
1
import {Component, Input, ViewChild} from '@angular/core';
1
import {Component} from '@angular/core';
2 2
import {SearchCustomFilter} from "../../openaireLibrary/searchPages/searchUtils/searchUtils.class";
3
import {ActivatedRoute} from "@angular/router";
4
import {FilterInfo, PortalAggregators} from "../../utils/aggregators";
3 5

  
4 6
@Component({
5 7
    selector: 'openaire-search-orps',
......
11 13
})
12 14

  
13 15
export class OpenaireSearchOrpsComponent {
14
    customFilter:SearchCustomFilter= new SearchCustomFilter();
15
    constructor () {
16
        this.customFilter.set("Country", "country", "CA" , "Canada");
16
    customFilter: SearchCustomFilter = null;
17

  
18
    constructor(private  route: ActivatedRoute) {
19

  
17 20
    }
21

  
18 22
    ngOnInit() {
19

  
23
        let id = this.route.snapshot.paramMap.get('id');
24
        let agg: FilterInfo = PortalAggregators.getFilterInfoByMenuId(id);
25
        this.customFilter = PortalAggregators.getSearchCustomFilterByAggregator(agg);
20 26
    }
21 27
}

Also available in: Unified diff