You are not logged in.



  • "xhe" started this thread

Posts: 12

Location: Sunnyvale, California, USA

  • Send private message


Saturday, July 13th 2019, 3:04pm

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

I am using krPano in angular 6,

ngAfterViewInit() {
if (this.panoConfigPath) {
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"/>

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.