openaire-library/utils/metaTags/openaireMetaTags.class.ts

22 lines
601 B
TypeScript
Raw Normal View History

import {Meta} from '../../sharedComponents/metaService';
export class OpenaireMetaTags{
constructor (private _meta: Meta ) {
}
updateDescription(description:string){
this._meta.updateMeta("description", description);
this._meta.updateProperty("og:description", description);
}
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);
}
updateUrl(url:string){
this._meta.updateProperty("og:url", url);
}
}