Revision 51842
Added by Sofia Baltzi over 6 years ago
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/metaTags/openaireMetaTags.class.ts | ||
---|---|---|
1 |
import {Meta} from '../../sharedComponents/metaService'; |
|
2 |
|
|
3 |
export class OpenaireMetaTags{ |
|
4 |
|
|
5 |
constructor (private _meta: Meta ) { |
|
6 |
} |
|
7 |
|
|
8 |
updateDescription(description:string){ |
|
9 |
this._meta.updateMeta("description", description); |
|
10 |
this._meta.updateProperty("og:description", description); |
|
11 |
} |
|
12 |
updateTitle(title:string){ |
|
13 |
var _prefix ="OpenAIRE | "; |
|
14 |
var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); |
|
15 |
this._meta.setTitle(_title ); |
|
16 |
this._meta.updateProperty("og:title",_title); |
|
17 |
} |
|
18 |
updateUrl(url:string){ |
|
19 |
this._meta.updateProperty("og:url", url); |
|
20 |
} |
|
21 |
} |
|
1 |
// import {Meta} from '../../sharedComponents/metaService'; |
|
2 |
// |
|
3 |
// export class OpenaireMetaTags{ |
|
4 |
// |
|
5 |
// constructor (private _meta: Meta ) { |
|
6 |
// } |
|
7 |
// |
|
8 |
// updateDescription(description:string){ |
|
9 |
// this._meta.updateMeta("description", description); |
|
10 |
// this._meta.updateProperty("og:description", description); |
|
11 |
// } |
|
12 |
// updateTitle(title:string){ |
|
13 |
// var _prefix ="OpenAIRE | "; |
|
14 |
// var _title = _prefix + ((title.length> 50 ) ?title.substring(0,50):title); |
|
15 |
// this._meta.setTitle(_title ); |
|
16 |
// this._meta.updateProperty("og:title",_title); |
|
17 |
// } |
|
18 |
// updateUrl(url:string){ |
|
19 |
// this._meta.updateProperty("og:url", url); |
|
20 |
// } |
|
21 |
// } |
Also available in: Unified diff
Comment out MetaService