Use Meta and Title Services from angular-platform-browser
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@51621 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
97fd1e4f05
commit
e4e6863ea6
|
@ -25,7 +25,7 @@
|
||||||
"h2020Guidlines" : "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020",
|
"h2020Guidlines" : "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020",
|
||||||
"ercGuidlines" : "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf",
|
"ercGuidlines" : "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf",
|
||||||
"helpdesk" : "https://www.openaire.eu/support/helpdesk",
|
"helpdesk" : "https://www.openaire.eu/support/helpdesk",
|
||||||
"uploadService" : "https://demo.openaire.eu/upload",
|
"uploadService" : "https://demo.openaire.eu/upload/",
|
||||||
|
|
||||||
"vocabulariesAPI" :"https://beta.services.openaire.eu/provision/mvc/vocabularies/",
|
"vocabulariesAPI" :"https://beta.services.openaire.eu/provision/mvc/vocabularies/",
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="uk-card uk-card-default uk-card-small uk-card-body">
|
<div class="uk-card uk-card-default uk-card-small uk-card-body">
|
||||||
<div *ngIf="projectTotal != null">
|
<div *ngIf="projectTotal != null">
|
||||||
<a [queryParams]=params routerLinkActive="router-link-active" routerLink="/search/find/projects"><h3 class="uk-card-title">{{projectTotal}}</h3>
|
<a routerLinkActive="router-link-active" routerLink="/search/find/projects"><h3 class="uk-card-title">{{projectTotal}}</h3>
|
||||||
<p>projects</p></a>
|
<p>projects</p></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="uk-card uk-card-default uk-card-small uk-card-body">
|
<div class="uk-card uk-card-default uk-card-small uk-card-body">
|
||||||
<div *ngIf="contentProviderTotal != null">
|
<div *ngIf="contentProviderTotal != null">
|
||||||
<a [queryParams]=params routerLinkActive="router-link-active" routerLink="/search/find/dataproviders"><h3 class="uk-card-title">{{contentProviderTotal}}</h3>
|
<a routerLinkActive="router-link-active" routerLink="/search/find/dataproviders"><h3 class="uk-card-title">{{contentProviderTotal}}</h3>
|
||||||
<p>content providers</p></a>
|
<p>content providers</p></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,10 +9,8 @@ import { ErrorCodes} from '../openaireLibrary/utils/properties/
|
||||||
import {CommunityService} from "../openaireLibrary/connect/community/community.service";
|
import {CommunityService} from "../openaireLibrary/connect/community/community.service";
|
||||||
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service';
|
||||||
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
|
||||||
import {Meta} from '../openaireLibrary/sharedComponents/metaService';
|
|
||||||
import {SearchEntriesService} from '../searchEntries/searchEntries.service';
|
import {SearchEntriesService} from '../searchEntries/searchEntries.service';
|
||||||
|
import {Title, Meta} from '@angular/platform-browser';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'community',
|
selector: 'community',
|
||||||
templateUrl: 'community.component.html',
|
templateUrl: 'community.component.html',
|
||||||
|
@ -44,7 +42,7 @@ export class CommunityComponent {
|
||||||
constructor (
|
constructor (
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
private location: Location, private _meta: Meta,
|
private location: Location, private _meta: Meta, private _title: Title,
|
||||||
private _piwikService:PiwikService,
|
private _piwikService:PiwikService,
|
||||||
private config: ConfigurationService,
|
private config: ConfigurationService,
|
||||||
private _communityService:CommunityService,
|
private _communityService:CommunityService,
|
||||||
|
@ -52,11 +50,11 @@ export class CommunityComponent {
|
||||||
|
|
||||||
var description = "Community Dashboard";
|
var description = "Community Dashboard";
|
||||||
var title = "Community Dashboard";
|
var title = "Community Dashboard";
|
||||||
|
this._meta.updateTag({content:description},"name='description'");
|
||||||
|
this._meta.updateTag({content:description},"property='og:description'");
|
||||||
|
this._meta.updateTag({content:title},"property='og:title'");
|
||||||
|
this._title.setTitle(title);
|
||||||
|
|
||||||
this._meta.setTitle(title);
|
|
||||||
this._meta.updateMeta("description", description);
|
|
||||||
this._meta.updateProperty("og:description", description);
|
|
||||||
this._meta.updateProperty("og:title", title);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
|
@ -64,7 +62,7 @@ export class CommunityComponent {
|
||||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||||
this.properties = data.envSpecific;
|
this.properties = data.envSpecific;
|
||||||
var url = data.envSpecific.baseLink+this._router.url
|
var url = data.envSpecific.baseLink+this._router.url
|
||||||
this._meta.updateProperty("og:url", url);
|
this._meta.updateTag({content:url},"property='og:url'");
|
||||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||||
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE").subscribe();
|
this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE").subscribe();
|
||||||
}
|
}
|
||||||
|
@ -82,10 +80,11 @@ export class CommunityComponent {
|
||||||
community => {
|
community => {
|
||||||
this.community = community;
|
this.community = community;
|
||||||
this.params = {community: encodeURIComponent('"'+community.queryId+'"')};
|
this.params = {community: encodeURIComponent('"'+community.queryId+'"')};
|
||||||
this._meta.setTitle(community.title);
|
this._meta.updateTag({content:community.description},"name='description'");
|
||||||
this._meta.updateMeta("description", community.description);
|
this._meta.updateTag({content:community.description},"property='og:description'");
|
||||||
this._meta.updateProperty("og:description", community.description);
|
this._meta.updateTag({content:community.title},"property='og:title'");
|
||||||
this._meta.updateProperty("og:title", community.title);
|
this._title.setTitle(community.title);
|
||||||
|
|
||||||
//console.log(community);
|
//console.log(community);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue