Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTomasz Sporys
11,258 PointsWhy do we populate properties in Controller not model?
In the video we created comicBook(model) and populate all its properties in Controller but we were told that all the data are coming from and are kept in Model. Is it how you do it in MVC? Do I just use a Model as a template and create objects and put all the data in Controller? Thanks for answer:)
1 Answer
Steven Parker
231,269 PointsThe model typically defines the structure of the data.
As you said, it serves as a "template", defining the data-holding object. It's a typical job of the controller to construct and fill the model, and then pass it along to the view.