Uncaught TypeError: Cannot read property 'app' of undefined-Collection of common programming errors
options
will be generated from the object that you supply to the constructor of your view. It includes everything except for things like model
and collection
var rv = new resultView({model: something, app: something})
Which can then be accessed like so
var resultView = Marionette.CompositeView.extend({
itemView : ResultItemView,
initialize : function(options) {
this.app = options.something;
},
itemViewOptions : {
app : this.options.app
},
If you want to refer to these options in another method, you will need to attach the required variables to the view (this
) itself.
You can’t access things like the model
from the options parameter, however they will automatically be attached to your view
Originally posted 2013-11-09 21:06:34.