1
|
import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core';
|
2
|
import {Observable} from 'rxjs/Observable';
|
3
|
import {ActivatedRoute, Router} from '@angular/router';
|
4
|
import {Location} from '@angular/common';
|
5
|
|
6
|
import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
7
|
import {ErrorCodes} from '../utils/properties/openaireProperties';
|
8
|
import {RouterHelper} from '../utils/routerHelper.class';
|
9
|
import {Session} from '../login/utils/helper.class';
|
10
|
|
11
|
@Component({
|
12
|
selector: 'reload',
|
13
|
template: `
|
14
|
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
|
15
|
<div uk-grid uk-grid>
|
16
|
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
|
17
|
<div class="uk-container uk-margin-top publication">
|
18
|
Go to initial page....
|
19
|
</div>
|
20
|
</div>
|
21
|
</div>
|
22
|
</div>
|
23
|
`
|
24
|
})
|
25
|
export class ReloadComponent {
|
26
|
|
27
|
constructor (
|
28
|
private route: ActivatedRoute,
|
29
|
private _router: Router,
|
30
|
private location: Location
|
31
|
) {
|
32
|
|
33
|
}
|
34
|
|
35
|
public ngOnInit() {
|
36
|
|
37
|
var url = Session.getCurrentUrl();
|
38
|
if(url && url != null && url != ""){
|
39
|
Session.setCurrentUrl("");
|
40
|
var paramsObject = Session.getCurrentParameters();
|
41
|
Session.setCurrentParameters("");
|
42
|
if(paramsObject && paramsObject != null){
|
43
|
this._router.navigate([url],{ queryParams: paramsObject});
|
44
|
}else{
|
45
|
this._router.navigate([url]);
|
46
|
}
|
47
|
}else{
|
48
|
this._router.navigate(['/']);
|
49
|
|
50
|
}
|
51
|
}
|
52
|
|
53
|
}
|