I\'ve been reading this: https://developers.facebook.com/docs/sharing/reference/share-dialog
and I need to import the facebook SDK in order to use the following code
If you want to get access inside your any.component.ts file you'll need get a window
referece (Iam using the follwing code):
function _window():any {
return window;
}
export class WindowRef {
public static get():any {
return _window();
}
}
Now you can:
import { WindowRef } from './windowRef';
export class AnyComponent {
WindowRef.get().FB.ui // <-- this is how you'll reference it now
}
You'll need to make sure, that the FB
Object is availabe on window
. Afterwards your code will transpile.