Component Router does not work with Upgrade Adapter
See original GitHub issueWhen trying to use the Angular 2 Component Router (Angular 2 RC 4) with the upgrade adapter I got the following error:
Bootstrap at least one component before injecting Router. at setupRouter
This is my main.ts file:
angular.module(moduleName).directive('App', upgradeAdapter.downgradeNg2Component(AppComponent));
upgradeAdapter.addProvider(APP_ROUTER_PROVIDERS);
upgradeAdapter.bootstrap(document.body, [moduleName]);
I google the problem and found the following links, but they all correspond to the router deprecated module as the Angular team changed how the router works since RC4:
https://github.com/angular/angular/issues/7147?_pjax=%23js-repo-pjax-container
Any ideas?
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
React Router stop working after upgrade React - Stack Overflow
0.0 to the last version to use Hook, after the upgrade, React Router stop working. This is the AppRoute code: import React from...
Read more >Troubleshoot Router Interface Issues - Cisco
This document describes how to troubleshoot interfaces that are down on router ethernet links.
Read more >7 Ways to Fix “Default Gateway Is Not Available” Error
How to Fix the Error · Go to the device manager on your PC. · Then expand the network adapter option by right-clicking...
Read more >How to get back online after a Windows 10 update breaks ...
In this guide, we'll walk you through the troubleshooting steps to fix network connectivity issues after installing an update on Windows 10.
Read more >Wi-Fi Adapter Is Disabled or Is Not Working - Intel
Update firmware on your wireless access point's Wi-Fi modem, router, or extender. Old firmware can cause this issue as the adapter will disable...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ptomaszi
provideRouter
is being deprecated as of RC5, so as a disclaimer this is subject to change but since you’re using ngUpgrade, you’ll need to override theApplicationRef
in theproviders
of yourAppComponent
Plunker: http://plnkr.co/edit/vpLkEY?p=preview
"@angular/router": "3.1.1"
doesn’t call initial navigation automatically.Calling initialNavigation() in AppComponent fixed the issue: