Comments (8)
It looks then like an ordering problem. Angular processes the routes in order. If it sees the wildcard route before the product routes it will never see the product routes.
My working code is at the office and I won't be back there until Friday. But you could try switching these two lines:
ProductModule
AppRoutingModule
from angular-gettingstarted.
Note:
If we remove
{ path: '**', redirectTo: 'welcome', pathMatch: 'full' }
it works... but then we lost that functionality
from angular-gettingstarted.
Do you see any messages in the F12 developer tools.
from angular-gettingstarted.
No messages
from angular-gettingstarted.
I work with your last Final version, and I put only the lines of your slides. :) (by the way)
from angular-gettingstarted.
Well, I've found a way to make it work:
transfer the responsability of { path: '**', redirectTo: 'welcome', pathMatch: 'full' }
to the ProductRoutingModule:
RouterModule.forChild([ { path: 'products', component: ProductListComponent }, { path: 'product/:id', canActivate: [ProductDetailGuard], component: ProductDetailComponent }, { path: '**', redirectTo: 'welcome', pathMatch: 'full' } ])
I'm not sure if it's an ugly solution, :) (but it works)
from angular-gettingstarted.
You're absolutely right.... that solves the problem.
Thank you! (Nice weekend)
from angular-gettingstarted.
Great!
from angular-gettingstarted.
Related Issues (20)
- Cannot run APM-Start HOT 2
- Exception while running [email protected] similiar to Issue 129 HOT 8
- Question: How can implement pagination? HOT 1
- Codesandbox.io Can't resolve all parameters for ProductListComponent: (?). HOT 4
- id issue HOT 1
- request to http://registry.npmjs.org/@angular-devkit%2fbuild-angular failed, reason: connect ECONNREFUSED 127.0.0.1:4200 HOT 12
- "Unable to resolve dependency tree" error during NPM install of APM-Start HOT 31
- Add a simple html page for product display HOT 1
- npm install not working HOT 3
- Angular npm start error HOT 2
- I think the course is missing explanation on the #variable in templates HOT 1
- I made the API for fetching data from back end service using Asp.net Core 5.0 HOT 1
- When creating a new project I get this error HOT 3
- Npm Err! code ELIFECYCLE When Npm Install , Also when running npm start ( Ionic Angular Project ) HOT 1
- Images not displaying on the initial setup thro Pluralsight HOT 2
- Blank Screen HOT 2
- Npr Errr HOT 7
- npm install --dev css-loader style-loader
- Unable to resolve "Conflicting peer dependencies" HOT 2
- Error in building an angular app. HOT 2
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 angular-gettingstarted.