javascript - How to ensure all views on App object get defined before loading -


i have backbone app uses global app namespace this

var app = app || {}; app.config = {}; app.models = {}; app.views = {}; app.collections = {}; 

in file /views/myappviews.js, have twelve different views defined on app.views namespace, such as

  app.views.blahblahview = backbone.view.extend({   }); 

if inspect app object in console in route application runs , shows each of twelve different views defined on app.object. however, in test part of application @ test.html, require of application files like

  <script src="../app/views/myappviews.js"></script> 

and when inspect app object in console, shows first 3 views defined in file this

    object          views              homeview              blahblahview              fooview 

so when try test of other 9 views defined later in file, says undefined, though put script tags file above actual test specs. (as far models go, however, 8 or 9 models defined in ../app/models/mymodels.js visible on app object in test route).

why of views defined on app object in file visible , how arrange visible in test area of application?


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -