Hi, I am just going through To-Do tutorial an I am trying to understand the mindset behind Meteor since tutorial only says how to do things but it doesn’t explains why are things done that way.
Why HTML template references ViewController when it needs to fill data like {{hideCompleted}}?
But ViewController references HTML template to assign events to elements like
“change .hide-completed input”: function (event) { … }?
I was under impression that in MVC View should have no knowledge on ViewController and its inner structure?
As it stands HTML template needs to know which function to call from ViewController to populate itself.
Shouldn’t populating parts of HTML Template be done similar to how event works?
That is ViewController should located specific element by using class and the structure of the HTML Template and then insert values in referenced element.
In other words if I change the name of the function {{hideCompleted}} inside controller to something else then I have to go through all HTML Templates that use that function and rename it there also.
Can I define event and handler function inside HTML Template?
Can I populate HTML Template from ViewControler to avoid referencing ViewControler functions/helpers from HTML Template?