routing-controllers
routing-controllers copied to clipboard
fix: create controllers in specified order
Description
Controllers are created in the order they are passed into the router controller options, not in the order they are registered with metadata
Checklist
- [x] the pull request title describes what this PR does (not a vague title like
Update index.md
) - [x] the pull request targets the default branch of the repository (
develop
) - [x] the code follows the established code style of the repository
-
npm run prettier:check
passes -
npm run lint:check
passes
-
- [x] tests are added for the changes I made (if any source code was modified)
- [x] documentation added or updated
- [x] I have run the project locally and verified that there are no errors
Fixes
Fixes typestack/routing-controllers#774
I faced the same problem that mentioned in #774 in a bit different manner.
I agree that import ordering in server bootstrap is counter-intuitive and hope this will be merged, or at least there'll be some explanation in docs for @Controller
and @{Method}
parametrized decorators.
+1 for this. Frustrating and counter intuitive.
This is reasonable and I agree with the solution, but this might be breaking for some people who rely solely on the workaround. @NoNameProvided thoughts?