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 {Component, ViewChild} from '@angular/core';
|
||||||
import {Observable} from 'rxjs/Observable';
|
import {ElementRef, Input} from '@angular/core';
|
||||||
import {DatasetService} from './dataset.service';
|
|
||||||
import {DatasetInfo} from '../../utils/entities/datasetInfo';
|
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
import {Title, Meta} from '@angular/platform-browser';
|
||||||
import { Meta} from '../../sharedComponents/metaService';
|
|
||||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
import {Observable} from 'rxjs/Observable';
|
||||||
|
|
||||||
|
import {DatasetInfo} from '../../utils/entities/datasetInfo';
|
||||||
import {EnvProperties} from '../../utils/properties/env-properties';
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||||
|
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||||
|
|
||||||
|
import {DatasetService} from './dataset.service';
|
||||||
|
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'dataset',
|
selector: 'dataset',
|
||||||
|
@ -53,6 +58,7 @@ export class DatasetComponent {
|
||||||
private _piwikService:PiwikService,
|
private _piwikService:PiwikService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private _meta: Meta,
|
private _meta: Meta,
|
||||||
|
private _title: Title,
|
||||||
private _router: Router) {
|
private _router: Router) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,17 +158,17 @@ export class DatasetComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateDescription(description:string){
|
private updateDescription(description:string){
|
||||||
this._meta.updateMeta("description", description);
|
this._meta.updateTag({content:description},"name='description'");
|
||||||
this._meta.updateProperty("og:description", description);
|
this._meta.updateTag({content:description},"property='og:description'");
|
||||||
}
|
}
|
||||||
private updateTitle(title:string){
|
private updateTitle(title:string){
|
||||||
var _prefix ="OpenAIRE | ";
|
var _prefix ="OpenAIRE | ";
|
||||||
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
|
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title);
|
||||||
this._meta.setTitle(_title );
|
this._title.setTitle(_title);
|
||||||
this._meta.updateProperty("og:title",_title);
|
this._meta.updateTag({content:_title},"property='og:title'");
|
||||||
}
|
}
|
||||||
private updateUrl(url:string){
|
private updateUrl(url:string){
|
||||||
this._meta.updateProperty("og:url", url);
|
this._meta.updateTag({content:url},"property='og:url'");
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildCurationTooltip() {
|
public buildCurationTooltip() {
|
||||||
|
|
|
@ -2,32 +2,33 @@
|
||||||
import {NgModule} from '@angular/core';
|
import {NgModule} from '@angular/core';
|
||||||
import {CommonModule} from '@angular/common';
|
import {CommonModule} from '@angular/common';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import { SharedModule } from '../../shared/shared.module';
|
|
||||||
import {RouterModule} from '@angular/router';
|
import {RouterModule} from '@angular/router';
|
||||||
|
|
||||||
import { DatasetService} from './dataset.service';
|
import {SharedModule} from '../../shared/shared.module';
|
||||||
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 { ResultLandingModule } from '../landing-utils/resultLanding.module';
|
import {DatasetComponent} from './dataset.component';
|
||||||
|
|
||||||
|
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
|
||||||
|
// import {DatasetRoutingModule} from './dataset-routing.module';
|
||||||
import {LandingModule} from '../landing-utils/landing.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 {FreeGuard} from'../../login/freeGuard.guard';
|
import {FreeGuard} from'../../login/freeGuard.guard';
|
||||||
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
|
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
|
||||||
|
|
||||||
import {MetaModule} from '../../sharedComponents/metaService.module';
|
|
||||||
import { ConfigurationServiceModule } from '../../utils/configuration/configurationService.module';
|
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
//MaterialModule.forRoot(),
|
//MaterialModule.forRoot(),
|
||||||
CommonModule, FormsModule,SharedModule, RouterModule, LandingModule, CiteThisModule,
|
CommonModule, FormsModule, SharedModule, RouterModule, LandingModule,
|
||||||
ResultLandingModule, MetricsModule, IFrameModule, AltMetricsModule,
|
CiteThisModule, ResultLandingModule, MetricsModule, IFrameModule,
|
||||||
MetaModule, ConfigurationServiceModule
|
AltMetricsModule, ConfigurationServiceModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
DatasetComponent
|
DatasetComponent
|
||||||
|
@ -39,4 +40,5 @@ import { ConfigurationServiceModule } from '../../utils/configuration/configurat
|
||||||
DatasetComponent
|
DatasetComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
export class DatasetModule { }
|
export class DatasetModule { }
|
||||||
|
|
Loading…
Reference in New Issue