Less boilerplate in Backbone Views
First create a BaseView

Now create a simple backbone view

You see, you don't need to declare render method in HelloWorldView,
What if you need to render a model data in render method?
Remember we check if serializeData is defined in BaseView

If you need to render a collection you can easily do it

If you need to do more stuff inside of render method in BaseView, just create a onRender method on the child view and call it in render method

If onRender defined in child view just call it

credits Derick Bailey
Written by Rafael Jesus
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Backbone patterns
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#