#I need help with the Slug! See the Github repository

25 messages · Page 1 of 1 (latest)

lofty girder
#

Hi there!

I can't figure out how to let the SLUG work properly. This is a personal project for learning purpose only.

The url should be as follow http://localhost:4200/tours-bangkok/tour-of-bangkok-ancient-city
It's currenlty http://localhost:4200/tours-bangkok/tour-bangkok-dett/1

Check the repository https://github.com/PaoloAngel/bkk-tours.git

I will be happy if someone could explain me what I doing wrong.

GitHub

Contribute to PaoloAngel/bkk-tours development by creating an account on GitHub.

sharp topaz
#

Hello, the repository is empty

lofty girder
sharp topaz
#

Nvm

#

Please show the code leading to the wrong url (that's hard to explore a project without details).

sharp topaz
#

Show code directly, that's about small snippets (plus I'm on a train 🚂)

#

Which code generate the wrong url?

lofty girder
#

I can't figure out which snippet is responsible

#

I never done that before

sharp topaz
#

You have a link/button to handle the navigation, that's where you defined the target route.

sharp topaz
west saffronBOT
# lofty girder I never done that before

Hi @lofty girder, you can use the following snippet to have your code formatted and syntax highlighted by Discord. Replace ts with the language you need (i.e. html, js, css, etc).

```ts
// your code goes here
```

lofty girder
#
    if (tour) {
      this.toursService.setActiveTour(tour);
      this.router.navigate([
        `/${AppRoutes.TOURS_BANGKOK}/${AppRoutes.TOUR_BANGKOK_DETAILS}`,
        tour.id,
      ]);
    }
  }

sharp topaz
#

Based on the url you provided in the first message

lofty girder
#

I am not sure if the issue lies in this part.

sharp topaz
#

If the problem is by calling this function, then yes. It matches the url you currently get

lofty girder
#

Let me know how to modify it please. I will try if it works

#

If you have time have a look the rest of the codes. I am not sure I've compiled correclty.

sharp topaz
lofty girder
#

ok

#

tnx