You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I understand controller collections bind with view regions by the same name.
I think it is wrong, because of two reasons.
First: it looks like magic, I was looking for some code which binds this collection for a while before I understand that they are bind behind the scene, by names.
Second: I understand controllers as code which glue two separate APIs: model and view. Expecting that there will be a collection with the same names looks wrong.
The text was updated successfully, but these errors were encountered:
There's one more thing wrong here – collections of controller collections. This is super confusing.
We should try to achieve something like:
classSomeControllerextendsController{constructor(){this.items=newControllerCollection(this.view.items);// Maps ctrl items into view items.// or, if the parent controller must know about its child collection (and its children):this.addCollection('items');
What's more, since the SomeController#items would often be mapped into some other collection (model), this could perhaps even look like this:
// or this.bind()this.map(this.items).to(this.view.items,(itemModel)=>{returnnewController(itemModel,newItemView());});
Of course, these are only some wild ideas. We need to understand whether they can be translated into something useful and something that can work.
As far as I understand controller collections bind with view regions by the same name.
I think it is wrong, because of two reasons.
First: it looks like magic, I was looking for some code which binds this collection for a while before I understand that they are bind behind the scene, by names.
Second: I understand controllers as code which glue two separate APIs: model and view. Expecting that there will be a collection with the same names looks wrong.
The text was updated successfully, but these errors were encountered: