Project

General

Profile

« Previous | Next » 

Revision 51752

Replace Meta service Import and use with Meta and Title from angular/platform-browser for communityErrorPage.component and communityError.module

View differences:

modules/uoa-services-library/trunk/ng-openaire-library/src/app/connect/communityGuard/communityErrorPage.component.ts
1
import { Component, Input } from '@angular/core';
2
import { Location } from '@angular/common';
3
import { Meta} from '../../sharedComponents/metaService';
4
import {ActivatedRoute} from '@angular/router';
1
import {Component, Input}         from '@angular/core';
2
import {Location}                 from '@angular/common';
3
import {ActivatedRoute}           from '@angular/router';
4
import {Title, Meta}              from '@angular/platform-browser';
5 5

  
6 6
@Component({
7 7
    selector: 'community-error',
......
15 15
                There is no community selected!
16 16
            </h2>
17 17
            <br>
18

  
19 18
            <p>
20 19
                If you are a community manager, click to manage from user menu.
21 20
            </p>
22

  
23
           
24 21
        </div>
25 22
      </div>
26 23
     </div>
......
31 28
export class CommunityErrorPageComponent {
32 29
    public page: string;
33 30

  
34
    constructor (private _location: Location, private _meta: Meta,private route: ActivatedRoute) {
35
        this._meta.setTitle("OpenAIRE | Error page");
31
    constructor (private _location: Location, private _meta: Meta,
32
                 private _title: Title, private route: ActivatedRoute) {
33

  
34
        var title = "OpenAIRE | Error page";
35

  
36
        this._title.setTitle(title);
36 37
        this.page = _location.path(true);
37 38
        //this.page = _router.url;
38 39
        //this.page = location.href;
39 40
    }
41

  
40 42
    ngOnInit() {
41 43
         this.route.queryParams.subscribe(data => {
44
            this.page = data['page'];
42 45

  
43

  
44
            this.page = data['page'];
45
            if(!this.page){
46
            if (!this.page) {
46 47
              this.page = this._location.path(true);
47 48
            }
48 49
          });
modules/uoa-services-library/trunk/ng-openaire-library/src/app/connect/communityGuard/communityError.module.ts
1
import { NgModule}            from '@angular/core';
2
import { CommonModule }        from '@angular/common';
3
import { FormsModule }         from '@angular/forms';
1
import {NgModule}                      from '@angular/core';
2
import {CommonModule}                  from '@angular/common';
3
import {FormsModule}                   from '@angular/forms';
4 4

  
5
import {CommunityErrorPageComponent } from './communityErrorPage.component';
6
import {MetaModule} from '../../sharedComponents/metaService.module';
5
import {CommunityErrorPageComponent}   from './communityErrorPage.component';
7 6

  
8 7
@NgModule({
9 8
  imports: [
10
    CommonModule, FormsModule, MetaModule
9
    CommonModule, FormsModule
11 10
  ],
12
  providers:[],
11
  providers: [],
13 12
  declarations: [
14 13
    CommunityErrorPageComponent
15
], exports:[CommunityErrorPageComponent]
14
  ],
15
  exports: [
16
    CommunityErrorPageComponent
17
  ]
16 18
})
17 19
export class CommunityErrorModule { }

Also available in: Unified diff