My model in my MVC template generates components at run time and gives them a view that will be displayed on the screen using the update () method (you know, the model is observable and the view is an observer). But I also need to add listeners to these components, and the controller has listener methods (because they say that the MVC pattern is similar to this), and it is not involved in this update process. Therefore, I cannot add listeners at runtime, but only in the controller constructor at startup.
I have an idea that makes the controller an observer, and then gives the data for presentation, and also adds listeners. Do you think everything will be alright?
source
share