usablica / intro.js

Lightweight, user-friendly onboarding tour library
http://introjs.com
Other
22.69k stars 2.59k forks source link

Where to use onexit() event? #2001

Closed Prshant-Sharma closed 10 months ago

Prshant-Sharma commented 10 months ago

I want to hit an API when tour exit or ends.

For that, I'm using onexit() event in ngOnInit() but seems like it doesn't work. Below is the snippet of what I'm doing:

ngOnInit(): void {
    introJs().onexit(() => {
      console.log(tour ends!);
    });
}

When I complete the tour or end it in middle, I expect to run this above code and print my console message but nothing happens.

Please assist me if I'm doing anything wrong to use onexit().

Specifications: Angular v13.1 intro.js v7.2.0