Comments (11)
Update: Working fine after upgrading to angular 5.
from ngx-bootstrap-product-tour.
@suparnavg No problem, let's figure this out.
First, please check that you are using latest version because the lazy loading bug was fixed with version 2.0.2
Let's do a quick check of the setup:
- You've imported NgxBootstrapProductTourModule.forRoot() in your main app
- You've imported NgxBootstrapProductTourModule in your lazy loaded module
- You've added to the root component
- You've called tourService.initialize and added all the steps in it
If you done all of these steps next thing you can do is add tourService.events$.subscribe(console.log); to the component where you initialize tourService so that you can see all tour steps that are being registered and all of their data.
Also in the demo there is example of lazy loaded module and that might help. The code can be found here
If you've done all above and it still doesn't work:
I would need you to provide me with some code example so I can debug it.
from ngx-bootstrap-product-tour.
Thanks @NMilicic - I've checked off all items on the checklist.
Logging the tourService events, I can see that all anchors are registered, as shown in the screenshot below.
Additionally, on launching the tour via tourService.toggle(), the stepShow event shows correctly, with the content of the tourStep.
Lastly, I verified that everything works fine if the tour is initiated in a non-lazy-loaded component.
Maybe my issue is caused because I am initiating the tour inside the lazy loaded component?
I am putting together a plunkr to replicate the issue. Will share it here.
from ngx-bootstrap-product-tour.
Here is a link to a repo that replicates the issue
I did some exploring of the package and if it helps - one or both of these conditions in this ngIf is evaluating to null.
*ngIf="tourService.currentStep?.backdrop && tourService.isStepOpen(tourService.currentStep)"
from ngx-bootstrap-product-tour.
Are you missing the import for the routingModule in product-tour-issue/src/app/app.module.ts?
Also can we highlight what
"You've added to the root component"
means. Added what?
from ngx-bootstrap-product-tour.
You're right @evm2556 , the import is missing in my demo repository - I left that out by mistake, now it is fixed. However this import was present in my project, so that is not causing the issue.
What i understood from ""You've added to the root component"" was has the line below been added to app.component.html or not.
<ngx-bootstrap-product-tour></ngx-bootstrap-product-tour>
from ngx-bootstrap-product-tour.
I've been able to reproduce the problem, but I have bad news :(
I'm not sure that I will be able to fix this for angular 4.
The problem is with the DI in angular 4. The NgxBootstrapTourService should be a singleton and that is achieved with .forRoot() import, but since I need to use a directive in the child module you need to declare NgxBootstrapModule in that child module and because of that only on lazy loaded modules new instance of the service is created.
I will investigate more during this week and try to find some solution.
from ngx-bootstrap-product-tour.
from ngx-bootstrap-product-tour.
@suparnavg Demo uses angular 5 and tour version 2.0.2 and it that version lazy loaded modules works fine.
The version 1.0.6. won't work with lazy loaded module especially if you plan to have a part of the tour in the module that is not lazy loaded and the part in the lazy loaded module and that is because of the DI.
from ngx-bootstrap-product-tour.
from ngx-bootstrap-product-tour.
from ngx-bootstrap-product-tour.
Related Issues (18)
- Problem with AOT compilation in angular4 HOT 1
- Bundled version of component failing. HOT 17
- Clicking anchors after tour ends displays empty popovers HOT 1
- Cannot redeclare block-scoped variable 'ngDevMode'. HOT 8
- Router error on angular5
- containerScrollTop is not defined HOT 3
- Pass boolean flag from one component to another component
- No component factory found. Did you add it to @NgModule.entryComponents? HOT 3
- Bootstrap 4 support
- tourService.end() called on Refresh.
- Can we add a image in popup?
- Angular 7 Support
- Error with build --prod ERROR in ./node_modules/ngx-bootstrap-product-tour/ngx-bootstrap-product-tour.es5.js 4:9
- Support for Angular 5 HOT 2
- ngx-bootstrap-product-tour is getting error as [email protected] is not supported with angular5 HOT 2
- unable to make it work on lazy load modules ngx-bootstrap-product-tour HOT 3
- Tour spanning multiple components HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-bootstrap-product-tour.