{"id":590,"date":"2022-08-30T15:03:53","date_gmt":"2022-08-30T15:03:53","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/uncaught-typeerror-cannot-read-property-app-of-undefined-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:03:53","modified_gmt":"2022-08-30T15:03:53","slug":"uncaught-typeerror-cannot-read-property-app-of-undefined-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/uncaught-typeerror-cannot-read-property-app-of-undefined-collection-of-common-programming-errors\/","title":{"rendered":"Uncaught TypeError: Cannot read property &#39;app&#39; of undefined-Collection of common programming errors"},"content":{"rendered":"<p><code>options<\/code> will be generated from the object that you supply to the constructor of your view. It includes everything except for things like <code>model<\/code> and <code>collection<\/code><\/p>\n<pre><code>var rv = new resultView({model: something, app: something})\n<\/code><\/pre>\n<p>Which can then be accessed like so<\/p>\n<pre><code>var resultView = Marionette.CompositeView.extend({\n        itemView : ResultItemView,\n        initialize : function(options) {\n             this.app = options.something;    \n        },\n        itemViewOptions : {\n            app : this.options.app\n        },\n<\/code><\/pre>\n<p>If you want to refer to these options in another method, you will need to attach the required variables to the view (<code>this<\/code>) itself.<\/p>\n<p>You can&#8217;t access things like the <code>model<\/code> from the options parameter, however they will automatically be attached to your view<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-09 21:06:34. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>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; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-590","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/590","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=590"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/590\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}