-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why does PrimeNg expect a router? How can I workaround this in beta14? #831
Comments
That is required for menu components to support routerLink functionality so that clicking on an item navigates to a view defined by the router, we are open to suggestions though. Not sure about dummy router. |
I ran into a similar issue. In my case my application is not using routing. I agree that router should be made optional since there is only one place in the code where the router is actually used. To work around this I created my own router service:
Then I modified my |
use as below @component({ |
Menu components require a router, not aware of a may to make it optional I'm afraid. |
Good Morning,
Question 1: I am not using a router in my Application, but PrimeNg expects a router to be injected. Why is this? Could this be made an optional provider?
Question 2:: What is the easiest way to pass in a dummy router?
In PrimeNG 1.0.0-beta.12 and below, I could do the following, to trick the components into thinking that there was a router:
In PrimeNG 1.0.0-beta.13, I moved the Router into the AppModule and the trick continued to work:
When I upgrade to PrimeNG 1.0.0-beta.14 this trick no longer works. What is the cleanest workaround?
The text was updated successfully, but these errors were encountered: