Replace Meta service Import and use with Meta and Title from angular/platform-browser for dataset.component and dataset.module
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51761 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
41056150fc
commit
68e52678fe
|
@ -1,12 +1,17 @@
|
|||
import {Component, ViewChild, ElementRef, Input} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {DatasetService} from './dataset.service';
|
||||
import {DatasetInfo} from '../../utils/entities/datasetInfo';
|
||||
import {Component, ViewChild} from '@angular/core';
|
||||
import {ElementRef, Input} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Title, Meta} from '@angular/platform-browser';
|
||||
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
|
||||
import {DatasetInfo} from '../../utils/entities/datasetInfo';
|
||||
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import { Meta} from '../../sharedComponents/metaService';
|
||||
|
||||
import {DatasetService} from './dataset.service';
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'dataset',
|
||||
|
@ -53,6 +58,7 @@ export class DatasetComponent {
|
|||
private _piwikService:PiwikService,
|
||||
private route: ActivatedRoute,
|
||||
private _meta: Meta,
|
||||
private _title: Title,
|
||||
private _router: Router) {
|
||||
}
|
||||
|
||||
|
@ -152,17 +158,17 @@ export class DatasetComponent {
|
|||
}
|
||||
|
||||
private updateDescription(description:string){
|
||||
this._meta.updateMeta("description", description);
|
||||
this._meta.updateProperty("og:description", description);
|
||||
this._meta.updateTag({content:description},"name='description'");
|
||||
this._meta.updateTag({content:description},"property='og:description'");
|
||||
}
|
||||
private updateTitle(title:string){
|
||||
var _prefix ="OpenAIRE | ";
|
||||
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
|
||||
this._meta.setTitle(_title );
|
||||
this._meta.updateProperty("og:title",_title);
|
||||
this._title.setTitle(_title);
|
||||
this._meta.updateTag({content:_title},"property='og:title'");
|
||||
}
|
||||
private updateUrl(url:string){
|
||||
this._meta.updateProperty("og:url", url);
|
||||
this._meta.updateTag({content:url},"property='og:url'");
|
||||
}
|
||||
|
||||
public buildCurationTooltip() {
|
||||
|
|
|
@ -1,33 +1,34 @@
|
|||
//import {MaterialModule} from '@angular/material';
|
||||
import { NgModule} from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { SharedModule } from '../../shared/shared.module';
|
||||
import { RouterModule } from '@angular/router';
|
||||
// import {MaterialModule} from '@angular/material';
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {RouterModule} from '@angular/router';
|
||||
|
||||
import {SharedModule} from '../../shared/shared.module';
|
||||
|
||||
import {DatasetComponent} from './dataset.component';
|
||||
|
||||
import { DatasetService} from './dataset.service';
|
||||
import { DatasetComponent } from './dataset.component';
|
||||
// import { DatasetRoutingModule } from './dataset-routing.module';
|
||||
import {MetricsModule} from '../landing-utils/metrics.module';
|
||||
import {IFrameModule} from '../../utils/iframe.module';
|
||||
import {AltMetricsModule} from '../../utils/altmetrics.module';
|
||||
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
|
||||
// import {DatasetRoutingModule} from './dataset-routing.module';
|
||||
import {LandingModule} from '../landing-utils/landing.module';
|
||||
import {ResultLandingModule} from '../landing-utils/resultLanding.module';
|
||||
import {MetricsModule} from '../landing-utils/metrics.module';
|
||||
import {AltMetricsModule} from '../../utils/altmetrics.module';
|
||||
import {ConfigurationServiceModule} from '../../utils/configuration/configurationService.module';
|
||||
import {IFrameModule} from '../../utils/iframe.module';
|
||||
|
||||
import {DatasetService} from './dataset.service';
|
||||
|
||||
import { ResultLandingModule } from '../landing-utils/resultLanding.module';
|
||||
import { LandingModule } from '../landing-utils/landing.module';
|
||||
import {FreeGuard} from'../../login/freeGuard.guard';
|
||||
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
|
||||
|
||||
import {MetaModule} from '../../sharedComponents/metaService.module';
|
||||
import { ConfigurationServiceModule } from '../../utils/configuration/configurationService.module';
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
//MaterialModule.forRoot(),
|
||||
CommonModule, FormsModule,SharedModule, RouterModule, LandingModule, CiteThisModule,
|
||||
ResultLandingModule, MetricsModule, IFrameModule, AltMetricsModule,
|
||||
MetaModule, ConfigurationServiceModule
|
||||
CommonModule, FormsModule, SharedModule, RouterModule, LandingModule,
|
||||
CiteThisModule, ResultLandingModule, MetricsModule, IFrameModule,
|
||||
AltMetricsModule, ConfigurationServiceModule
|
||||
],
|
||||
declarations: [
|
||||
DatasetComponent
|
||||
|
@ -39,4 +40,5 @@ import { ConfigurationServiceModule } from '../../utils/configuration/configurat
|
|||
DatasetComponent
|
||||
]
|
||||
})
|
||||
|
||||
export class DatasetModule { }
|
||||
|
|
Loading…
Reference in New Issue