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