1
|
import { Component, Input } from '@angular/core';
|
2
|
import { Location } from '@angular/common';
|
3
|
import { Meta} from '../../angular2-meta';
|
4
|
import {ActivatedRoute} from '@angular/router';
|
5
|
|
6
|
@Component({
|
7
|
selector: 'error',
|
8
|
template: `
|
9
|
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
|
10
|
<div uk-grid uk-grid>
|
11
|
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
|
12
|
|
13
|
<div class="uk-container">
|
14
|
<h2>
|
15
|
Bad karma: we can't find that page!
|
16
|
</h2>
|
17
|
<br>
|
18
|
|
19
|
<p>
|
20
|
You asked for {{page}}, but despite our computers looking very hard, we could not find it. What happened ?
|
21
|
</p>
|
22
|
|
23
|
<ul>
|
24
|
<li>the link you clicked to arrive here has a typo in it</li>
|
25
|
<li>or somehow we removed that page, or gave it another name</li>
|
26
|
<li>or, quite unlikely for sure, maybe you typed it yourself and there was a little mistake ?</li>
|
27
|
</ul>
|
28
|
|
29
|
</div>
|
30
|
</div>
|
31
|
</div>
|
32
|
</div>
|
33
|
`
|
34
|
})
|
35
|
|
36
|
export class ErrorPageComponent {
|
37
|
public page: string;
|
38
|
|
39
|
constructor (private _location: Location, private _meta: Meta,private route: ActivatedRoute) {
|
40
|
this._meta.setTitle("OpenAIRE | Error page");
|
41
|
this.page = _location.path(true);
|
42
|
//this.page = _router.url;
|
43
|
//this.page = location.href;
|
44
|
}
|
45
|
ngOnInit() {
|
46
|
this.route.queryParams.subscribe(data => {
|
47
|
|
48
|
|
49
|
this.page = data['page'];
|
50
|
if(!this.page){
|
51
|
this.page = this._location.path(true);
|
52
|
}
|
53
|
});
|
54
|
}
|
55
|
}
|