passing multiple /:slug in the main Route in Angular

Discussão em 'Angular' iniciado por Mohamed Sabry, Maio 12, 2025.

  1. currently i'm working on making my Angaulr19 routes to be the same with the Wordpres headless sitemap ! so it can work with the same old routes .

    but here's the issue :

    wordpress used to navigated through www.example.com/:slug always with products ! and categories and blogs with the same url !!

    in angular everytime i try this angular get confused and catch the first /:slug witch is Category . and when i navigate to product he give me 404 .

    i can't deal with it ! i i will share my code[​IMG]

    [​IMG]

    here's the Categories (the only one i have issues with is the main because he uses :slug)

    i tried to use a parent path like (Product , category , slug ), but the client refused and wanted the same exact thing in the old sitemap.

    btw i can add a new endpoint in Wordpress's backend so it may make it easier for me ! but i'm trying to avoid creating API calls

    here's the SiteMap [​IMG]

    [​IMG]

    Continue reading...

Compartilhe esta Página