Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(techniques/mvc): introduce @WithAlias() decorator #1400

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sjones6
Copy link

@sjones6 sjones6 commented Aug 2, 2020

Documents the @WithAlias() decorator and getUrl helper introduced in PR nestjs/nest#5117

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[x] Other... Please describe: docs

What is the current behavior?

Issue Number: See issue nestjs/nest#5117 and PR nestjs/nest#3743.

What is the new behavior?

Adds documentation for @WithAlias() decorator and getUrl() helper.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Documents the @WithAlias() decorator and getUrl helper introduced in PR nestjs/nest#5117
Comment on lines 109 to 118
@Get()
@Render('users-list')
@WithAlias('hello')
root(): User[] {
return [ /* list of users */ ];
}

@Get('/:user')
@Render('user')
@WithAlias('hello')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these two routes supposed to have the same alias?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmcdo29 , whoops. Nope. Correcting...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmcdo29 , should be updated now.

Correct route aliases to proper values reflecting the route
@RobertAKARobin
Copy link

What would it take to get this merged? I'd really like this feature.

@johannesschobel
Copy link
Contributor

The feature is available @RobertAKARobin , this is just the documentation.

@matulek
Copy link

matulek commented Feb 17, 2021

The feature is available @RobertAKARobin , this is just the documentation.

@johannesschobel - no, it's not, the PR is still open: nestjs/nest#5117

@johannesschobel
Copy link
Contributor

i am sorry, i must have missed that.

```
Once you have registered route aliases, you can access them via the `getUrl(routeAlias: string, routeParams?: object): string` method that is injected into the template render context.

```njk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this njk is making the building fails. Try text instead.

@AeroNotix
Copy link

Did this end up going any where?

@marcelobrk
Copy link

What happened to that PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants