javascript - Uncaught TypeError: Cannot read property 'app' of undefined -
i have composite view:
var resultview = marionette.compositeview.extend({ template : resultpanel, itemview : resultitemview, initialize : function() { ... }, itemviewoptions : { app : this.options.app },
i want assign view's app property itemview's app property. can use view's app other view. i'm getting error: uncaught typeerror: cannot read property 'app' of undefined. doing wrong? there way in order this?
possiblity #1: this.option not yet set when code executes.
possibility #2: maybe 'this' not expect be. assign var = this; before , use 'that' instead of 'this'.
or assign var _options = this.options; before extend() , use _options in extend.
Comments
Post a Comment