56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
import { Component, Input } from '@angular/core';
|
|
import { Location } from '@angular/common';
|
|
import { Meta} from '../sharedComponents/metaService';
|
|
import {ActivatedRoute} from '@angular/router';
|
|
|
|
@Component({
|
|
selector: 'error',
|
|
template: `
|
|
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
|
|
<div uk-grid uk-grid>
|
|
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
|
|
|
|
<div class="uk-container">
|
|
<h2>
|
|
Bad karma: we can't find that page!
|
|
</h2>
|
|
<br>
|
|
|
|
<p>
|
|
You asked for {{page}}, but despite our computers looking very hard, we could not find it. What happened ?
|
|
</p>
|
|
|
|
<ul>
|
|
<li>the link you clicked to arrive here has a typo in it</li>
|
|
<li>or somehow we removed that page, or gave it another name</li>
|
|
<li>or, quite unlikely for sure, maybe you typed it yourself and there was a little mistake ?</li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`
|
|
})
|
|
|
|
export class ErrorPageComponent {
|
|
public page: string;
|
|
|
|
constructor (private _location: Location, private _meta: Meta,private route: ActivatedRoute) {
|
|
this._meta.setTitle("OpenAIRE | Error page");
|
|
this.page = _location.path(true);
|
|
//this.page = _router.url;
|
|
//this.page = location.href;
|
|
}
|
|
ngOnInit() {
|
|
this.route.queryParams.subscribe(data => {
|
|
|
|
|
|
this.page = data['page'];
|
|
if(!this.page){
|
|
this.page = this._location.path(true);
|
|
}
|
|
});
|
|
}
|
|
}
|