ngx-joyride
Version:
[](https://badge.fury.io/js/ngx-joyride) [](https://travis-ci.org/tnicola/ngx-joyride) [ {
this.platformId = platformId;
this.stepService = stepService;
this.optionsService = optionsService;
this.tourInProgress = false;
}
startTour(options) {
if (!isPlatformBrowser(this.platformId)) {
return of(new JoyrideStepInfo());
}
if (!this.tourInProgress) {
this.tourInProgress = true;
if (options) {
this.optionsService.setOptions(options);
}
this.tour$ = this.stepService.startTour().pipe(finalize(() => (this.tourInProgress = false)));
this.tour$.subscribe();
}
return this.tour$;
}
closeTour() {
if (this.isTourInProgress())
this.stepService.close();
}
isTourInProgress() {
return this.tourInProgress;
}
}
JoyrideService.decorators = [
{ type: Injectable }
];
JoyrideService.ctorParameters = () => [
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
{ type: JoyrideStepService },
{ type: JoyrideOptionsService }
];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiam95cmlkZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LWpveXJpZGUvc3JjL2xpYi9zZXJ2aWNlcy9qb3lyaWRlLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLEVBQUUsV0FBVyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ2hFLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQzVELE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBRWxFLE9BQU8sRUFBYyxFQUFFLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFDdEMsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzFDLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBT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