Coder Social home page Coder Social logo

Comments (7)

LayZeeDK avatar LayZeeDK commented on June 3, 2024 1

Thanks for your answer! Unfortunately, :id.ts is an invalid filename in Windows ☚ī¸ (Colon is not allowed)

from ngext.

benwinding avatar benwinding commented on June 3, 2024 1

Oh no! Sorry about that, I had no idea, as I'm on Ubuntu.

Okay, I'll change it from : to the _ character, like this:

Page File                  Route (Generated)
~/pages/user/_id.ts   ->  /folder/:id

Thanks for reporting the issue, and let me know if there's anything else.

Cheers,
Ben

from ngext.

benwinding avatar benwinding commented on June 3, 2024 1

Dynamic routes now use _ in version 0.1.0 👍

from ngext.

LayZeeDK avatar LayZeeDK commented on June 3, 2024 1

Thanks for the quick fix!

How about nested parameterized routes such as:

  • /blog/:categoryId/:articleId
  • /catalog/:categoryId/:productId
  • /company/:customerId/offices/:officeId

Would it work with something like:

- company/
  - _customer-id.ts
  - _customer-id/
    - offices/
      - _office-id.ts

from ngext.

benwinding avatar benwinding commented on June 3, 2024 1

No worries! Yes that should work as expected. It will convert them for any amount of nested routes, like this:

Page File                                               Route (Generated)
~/pages/company/_customer-id/office/_office-id.ts   ->  /company/:customer-id/office/:office-id

Then you can access those params in the ActivatedRoute on the page component.

from ngext.

benwinding avatar benwinding commented on June 3, 2024

Hi @LayZeeDK,

Thanks for checking out the project! Yes, I need to work on the documentation a bit, but for now, this is what you're looking for:

parameterized page route

Simply putting a : in front of the page component filename, signifies that it is a Parametrized route, which will give you the params in ActivatedRoute.params

Page File                  Route
~/pages/user/:id.ts   ->  /folder/:id

Let me know if there's anything else you need.

Cheers,
Ben

from ngext.

LayZeeDK avatar LayZeeDK commented on June 3, 2024

Leaving this as closed. Thank you for the support!

from ngext.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.