You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

xhe

Beginner

  • "xhe" started this thread

Posts: 14

Location: Sunnyvale, California, USA

  • Send private message

1

Saturday, July 13th 2019, 3:04pm

Integrate krPano into angualar 6, how to call method inside component

Hello,
I am using krPano in angular 6,


ngAfterViewInit() {
if (this.panoConfigPath) {
embedpano({
swf: 'assets/lib/krpano/krpano.swf',
xml: this.panoConfigPath,
target: 'pano_player',
html5: 'auto',
mobilescale: 1.0,
passQueryParameters: true
});
}
}

Now it is all fine and can show the pano, but I now need to have call back handler in JS, see below:


<hotspot name="hp_click" style="roomspot|skin_tooltips" tooltip="Show Me" onclick="js(clickHs('pano3'))">
<point ath="-34" atv="11"/>
<point ath="-34" atv="16"/>
<point ath="-31" atv="17"/>
<point ath="-31" atv="11"/>
</hotspot>

When a hot spot is clicked, I need to call back to method in the angular 6 component method. But here, the js() method is global, I guess, so how to pass specific method inside component? Any idea?

I am now stuck here and have no idea on how to let krPano call back to the method inside the component.

Hope to hear your advice on this.