diff --git a/connect/communityGuard/communityError.module.ts b/connect/communityGuard/communityError.module.ts index a72efd14..5310e783 100644 --- a/connect/communityGuard/communityError.module.ts +++ b/connect/communityGuard/communityError.module.ts @@ -1,17 +1,19 @@ -import { NgModule} from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {FormsModule} from '@angular/forms'; -import {CommunityErrorPageComponent } from './communityErrorPage.component'; -import {MetaModule} from '../../sharedComponents/metaService.module'; +import {CommunityErrorPageComponent} from './communityErrorPage.component'; @NgModule({ imports: [ - CommonModule, FormsModule, MetaModule + CommonModule, FormsModule ], - providers:[], + providers: [], declarations: [ CommunityErrorPageComponent -], exports:[CommunityErrorPageComponent] + ], + exports: [ + CommunityErrorPageComponent + ] }) export class CommunityErrorModule { } diff --git a/connect/communityGuard/communityErrorPage.component.ts b/connect/communityGuard/communityErrorPage.component.ts index bd06cf93..65f74523 100644 --- a/connect/communityGuard/communityErrorPage.component.ts +++ b/connect/communityGuard/communityErrorPage.component.ts @@ -1,7 +1,7 @@ -import { Component, Input } from '@angular/core'; -import { Location } from '@angular/common'; -import { Meta} from '../../sharedComponents/metaService'; -import {ActivatedRoute} from '@angular/router'; +import {Component, Input} from '@angular/core'; +import {Location} from '@angular/common'; +import {ActivatedRoute} from '@angular/router'; +import {Title, Meta} from '@angular/platform-browser'; @Component({ selector: 'community-error', @@ -15,12 +15,9 @@ import {ActivatedRoute} from '@angular/router'; There is no community selected!
-

If you are a community manager, click to manage from user menu.

- - @@ -31,18 +28,22 @@ import {ActivatedRoute} from '@angular/router'; export class CommunityErrorPageComponent { public page: string; - constructor (private _location: Location, private _meta: Meta,private route: ActivatedRoute) { - this._meta.setTitle("OpenAIRE | Error page"); + constructor (private _location: Location, private _meta: Meta, + private _title: Title, private route: ActivatedRoute) { + + var title = "OpenAIRE | Error page"; + + this._title.setTitle(title); 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){ + + if (!this.page) { this.page = this._location.path(true); } });