title: Pass values between views in backbone
body: <p>I have 2 views and need to pass values between them.</p>
  
  <pre><code>var appModel1 = Backbone.Model.extend({
          url: '/',
          defaults: {
              name: 'Default name'
          },
          validate: function(attr){
  
          }
      });
  
      var appCollection1 = Backbone.Collection.extend({
          model: appModel1
      });
  
      var collection1 = new appCollection1();
  
      var model1 = new appModel1();
      model1.bind('change', function(){
          model1.save();
      });
  
  
      var appView1 = Backbone.View.extend({
          model: model1,
          _modelDataBind: undefined,
          el:'#container1',
          initialize: function(){
              this._modelDataBind = new Backbone.ModelBinder();
              this.render();
          },
          render: function(){
              var template = _.template($('#app1').html());
              this.$el.html(template);
              var bindings = {
                      name: '#txtName'
              };
              var changeTrigger = {
                      'changeTriggers': {
                          '': 'keyup',
                          '#txtName': 'keyup'
                      }
              };
              this._modelDataBind.bind(this.model, this.$el, bindings, changeTrigger);
          },
          'events': {
              'click #btnSubmit': 'addRecord'
          },
          addRecord: function(){
              collection1.push(model1);
              var item = '&lt;li&gt;Name: ' +  model1.get('name') + '&lt;/li&gt;';
              var app2 = new appView2({collection: collection1});
              $('#txtName').val('').focus();
          }
      });
      var view1 = new appView1({});
  
  
      var appView2 = Backbone.View.extend({
          el: '#container2',
          initialize: function(){
              this.render();
          },
          render: function(){
              var template = _.template($('#app2').html());
              this.$el.html(template);
              this.collection.each(function(model){
                  var item = '&lt;li&gt;Name: ' + model.get('name') + '&lt;/li&gt;';
                  $('#infoList').append(item);
              });
          }
      });
      var view2 = new appView2({});
  </code></pre>
  
  <p>As of now, I have only been able to pass values using collection and id variables.</p>
  
  <p>Are they reserved variables? </p>
  
  <p>Can i use any other variable to pass data?</p>
  
  <pre><code>var app2 = new appView2({nameObj: nameObj});
  </code></pre>
  
  <p>this fails.</p>