backbone.js - Correct way to add multiple backbone views to a parent view -
I have several vertebrates that create a screen, currently I am doing it like this:
render: function () {this. $ El.html (this.template ()); This.view2 = new View2 (); This.view2.render (); . This $ el.append (this.view2 $ l.); Is this the right way to handle multiple ideas or is there a better way to engage ideas in the current view?
I want to delete and reconstruct a view with relevant HTML extracted / removed from the original view without manually doing it.
Honestly, I really recommend checkout facilities with a spinal cord The app on the scale was created, and it can be called a real magic wand in sentences. This helps you avoid working with ideas from memory leaks and helps you codify more compact and obvious decreasing boilerplate code.
So in your case you can get layout views, create areas and present ideas in areas.
var layout = merianet Layout. Extensions ({Areas: {Head: "#head", Main: "# Main"}}); Var layout = new layout (); Layout.render (); Layout.main.show (new SomeView ());
Comments
Post a Comment