dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/addThis.component.ts @ 50169
1 |
import {Component, ElementRef, Input} from '@angular/core'; |
---|---|
2 |
import {ActivatedRoute} from '@angular/router'; |
3 |
|
4 |
interface addthis { |
5 |
layers: refresh; |
6 |
init: Function; |
7 |
}
|
8 |
interface refresh { |
9 |
refresh: Function; |
10 |
}
|
11 |
declare var addthis: addthis; |
12 |
|
13 |
//<addThis ></addThis>
|
14 |
@Component({ |
15 |
selector: 'addThis', |
16 |
template: ` |
17 |
<div class="addthis_inline_share_toolbox"></div>
|
18 |
`
|
19 |
})
|
20 |
export class AddThisComponent { |
21 |
private sub:any; |
22 |
|
23 |
|
24 |
constructor(private route: ActivatedRoute) { |
25 |
|
26 |
}
|
27 |
ngOnInit() { |
28 |
this.sub = this.route.queryParams.subscribe(data => { |
29 |
|
30 |
if (typeof document !== 'undefined') { |
31 |
try{ |
32 |
addthis.init(); |
33 |
addthis.layers.refresh(); |
34 |
}catch (e) { |
35 |
console.log(e); |
36 |
}
|
37 |
}
|
38 |
});
|
39 |
|
40 |
}
|
41 |
|
42 |
|
43 |
}
|