How to extract parameters from complex seo url for eg
domain.com/product-samsung-tv-34.html
Where 34 is the parameter to be pass to the respective component.
How to extract parameters from complex seo url for eg
domain.com/product-samsung-tv-34.html
Where 34 is the parameter to be pass to the respective component.
3
Answers
The solution using Angular 6 matcher and regular expression Using UrlMatcher or matcher:
YourMatcherLogic function
}
In the component get the extracted parameters as
You can simply read about that in the Angular router doc Here. Example in your component ngOnInt.
For anyone having to deal with the UrlMatcher.
This is how the default implementation does it.