title: Uncaught Type Error: View is not a constructor
body: <p>I have Uncaught Type Error : UserRegisterView is not a constructor.I dont understand this error.I looked all code but i dont find it.
  Sorry of my bad english.Please help me</p>
  
  <p>Thanks for answer</p>
  
  <p><strong>UPDATED</strong></p>
  
  <p>UserRegisterView is here </p>
  
  <pre class="lang-js prettyprint-override"><code>var UserRegisterView = Backbone.View.extend({
  
      model: User,
      el: '#form',
      events: {
          'click input[id="infoWeek"]': 'infoWeek',
          'click input[id="infoMonth"]': 'infoMonth'
      },
  
      infoWeek: function() {
  
          this.$el.find("#dayOfMonth").hide();
          this.render();
      },
  
      infoMonth: function() {
  
          this.$el.find("#dayOfWeek").hide();
          this.render();
  
      }
  });
  
  var AddUserView = Backbone.View.extend({
      el: $(".page"),
      events: {
          'click #saveUser': 'saveUser'
      },
      saveUser: function() {
          var user = new User();
          user.set({
              username: $("#username").val(),
              lastName: $("#lastName").val(),
              regNumber: $("#regNumber").val(),
              password: $("#password").val(),
              departmentName: $("#departmentName").val(),
              email: $("#email").val(),
              role: $("#role").val()
          });
          user.save();
  
          if (document.getElementById('isOpen').checked) {
              user.set("isOpen", $("#isOpen").val("1"));
              user.save();
          } else {
              user.set("isOpen", $("#isOpen").val("0"));
              user.save();
          }
  
          if (document.getElementById('dayOfWeek').checked) {
              user.set("dayOfWeek", $("#dayOfWeek").val());
              user.save();
          } else if (document.getElementById('dayOfMonth').checked) {
              user.set("dayOfMonth", $("#dayOfMonth").val());
              user.save();
          }
  
  
          $("#username").val("");
          $("#firstName").val("");
          $("#lastName").val("");
          $("#regNumber").val("");
          $("#password").val("");
          $("#deparmentName").val("");
          $("#email").val("");
          $("#isOpen").val("");
          $("#dayOfWeek").val("");
          $("#dayOfMonth").val("");
      },
  
      render: function() {
          var that = this;
          var template = Handlebars.compile(UserRegister);
          var myHtml = template(that.model.toJSON());
          that.$el.html(myHtml);
          return this;
      }
  });
  
  return {
      AddUserView: AddUserView,
      UserRegisterView: UserRegisterView
  };
  
  });
  </code></pre>
  
  <p>router user func.</p>
  
  <pre class="lang-js prettyprint-override"><code>define([
      'jquery',
      'underscore',
      'backbone',
      'handlebars',
      'spin',
      'app/models/LoginModel',
      'app/views/LoginView',
      'app/views/UserRegisterView'
  ], function($,
      _,
      Backbone,
      Handlebars,
      Spinner,
      Login,
      LoginView,
      UserRegisterView
  ) {
  
      var Router = Backbone.Router.extend({
          routes: {
              'search': 'search',
              'login': 'login',
              'travels': 'travels',
              'user': 'user',
              'menu': 'menu',
              '': 'home'
  
          },
          user: function() {
  
              disposeView(new UserRegisterView().render());
  
          }
  </code></pre>
  
  <p>dispose.view on util.js</p>
  
  <pre class="lang-js prettyprint-override"><code>function disposeView(view) {
      Backbone.View.prototype.close = function() {
          this.unbind();
          this.undelegateEvents();
      };
  
      /* Şu anki viewi yok et */
      if (this.currentView !== undefined) {
          this.currentView.close();
      }
  
      /* Yeni view oluştur. */
      this.currentView = view;
      this.currentView.delegateEvents();
  
      return this.currentView;
  }
  </code></pre>