mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 18:37:05 +00:00
❤️ awesome and unique features for end-developers are coming...
total refactor of the hero and mvc packages, see README#Next (it's not completed yet) Former-commit-id: b85ae99cbfe5965ba919c1e15cf4989e787982c0
This commit is contained in:
@@ -25,10 +25,10 @@ type TodoController struct {
|
||||
func (c *TodoController) BeforeActivation(b mvc.BeforeActivation) {
|
||||
// this could be binded to a controller's function input argument
|
||||
// if any, or struct field if any:
|
||||
b.Dependencies().Add(func(ctx iris.Context) (items []todo.Item) {
|
||||
b.Dependencies().Register(func(ctx iris.Context) (items []todo.Item) {
|
||||
ctx.ReadJSON(&items)
|
||||
return
|
||||
})
|
||||
}) // Note: from Iris v12.2 these type of dependencies are automatically resolved.
|
||||
}
|
||||
|
||||
// Get handles the GET: /todos route.
|
||||
|
||||
Reference in New Issue
Block a user