-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
base: master
Are you sure you want to change the base?
Conversation
Documents the @WithAlias() decorator and getUrl helper introduced in PR nestjs/nest#5117
content/techniques/mvc.md
Outdated
@Get() | ||
@Render('users-list') | ||
@WithAlias('hello') | ||
root(): User[] { | ||
return [ /* list of users */ ]; | ||
} | ||
|
||
@Get('/:user') | ||
@Render('user') | ||
@WithAlias('hello') |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmcdo29 , whoops. Nope. Correcting...
There was a problem hiding this comment.
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
What would it take to get this merged? I'd really like this feature. |
The feature is available @RobertAKARobin , this is just the documentation. |
@johannesschobel - no, it's not, the PR is still open: nestjs/nest#5117 |
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 |
There was a problem hiding this comment.
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.
Did this end up going any where? |
What happened to that PR? |
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?
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 andgetUrl()
helper.Does this PR introduce a breaking change?
Other information