Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Backbone View In Another View


      <script type = "text/javascript">
      
         var ViewDemo = Backbone.View.extend ({
      tagName: "div",
       template: _.template($("#helloWorld").html()),

             initialize: function(){
               this.render();
            },

             render: function(){

                 this.$el.html(this.template({name: 'Tutorialspoint...!'}));
            }
         });

         var myContentView = Backbone.View.extend({
      el: "#myContent",

      initialize: function()
      {
        const vd = new ViewDemo();
 this.$el.html(vd.template({name:"HI WORLD"}));

      }
         })
          var myview = new ViewDemo();
    
         var myContent = new myContentView();
 
PREVIOUS NEXT
Tagged: #Backbone #View #In #Another #View
ADD COMMENT
Topic
Name
9+3 =