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
Post a Comment