-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
MVC: service injecting fails #1343
Comments
@zheeeng The problem here is that |
This is the same as you posted before: #1342. These work: type controller struct {
Parser Parser
}
type controller struct {
Parser Parser
Service Service // (or interface {}, it's the same in your case)
} And that's because it tries to match it by order of registering, because the What we can do here? Here we can add "priorities" so the |
…nge the order of controller's fields and their registered valid dependencies relative to: #1343
Hello @zheeeng, With the recent commit we have added the ability to customize and change the order of fields and their valid available registered values (if more than one) through the func App(app *mvc.Application) {
app.SortByNumMethods()
parser := InitParser()
app.Register(parser)
app.Party("/parse").Configure(ParseApp)
} |
…nge the order of controller's fields and their registered valid dependencies relative to: kataras#1343 Former-commit-id: 5bd9e02e5fafca135d17cad87f4a9aec526b333b
This code will throw Internal Server Error:
cos the
c.Parser
isnil
If we change the controller to
There is no problems.
The text was updated successfully, but these errors were encountered: