I am building my application using backbone.js
As seen below, I have a layoutView that I use to render the layout as well as the mini profile in the layout.
I have a sync problem. I need to execute the render method first before running the renderProfile method. How can i do this?
Onethingaday.Views.Home ||= {} class Onethingaday.Views.Home.LayoutView extends Backbone.View template: JST["backbone/templates/home/layout"] initialize: -> @options.user.bind('change',@render,@renderProfile, @) renderProfile: -> view = new Onethingaday.Views.Shared.MiniProfileView user: @options.user @$('.profile').html view.render().el render: -> $(@el).html(@template()) @
source share