Second Model inside a View using Backbone
Trying to build a mobile app for a client I needed to add a second model inside a single view, apparently it doesn’t work out of the box.
After googling for a while, without success, I decided to go to the IRC and ask in there. As I expected I got the answer right away.
When you try to initialize a view inside a route like this:
And try to access it like this:
It won’t work.
You will need to get the second model from the parameters passed in the
initialize function when you create the view:
Thanks to systemfault on
##frontend for help me figure it out.