You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimized: Partials works nicely, unless they’re invoked from a template that is in turn invoked from _.map.
Unoptimized: Partials works no matter the context they’re in.
Am I supposed to bind my compiled template somehow, and if so, to what context?
Example given below
view.js
define(['marionette','hbs!./template','hbs!./accepted-sources-template'],function(Marionette,Template,AcceptedSourcesTemplate){returnMarionette.ItemView.extend({template: Template,setAcceptedSources: function(){// This here doesn’t work when code has been optimizedvaracceptedSources=_.chain(this.wrapper.sources).map(AcceptedSourcesTemplate).compact().value().join(',');this.$el.trigger('droppable:options:set',{accept: acceptedSources});}});});
accepted-sources-template.hbs
{{~#eachoperations~}}
#panel-right .aggregate[data-source*="{{>type-sub-type-operationtype=../typesub_type=../sub_typeoperation=this}}"] > div,#panel-right .results[data-source*="{{>type-sub-type-operationtype=../typesub_type=../sub_typeoperation=this}}"] > ol > li{{~#unless@last~}},{{~/unless~}}{{~/each~}}
The text was updated successfully, but these errors were encountered:
{{log this}} returns the correct attributes in all the templates.
The weird thing is that I can use other partials without any problems at all.
{{! The one causing problems – always called from inside a loop, thus the ../ and the this }}{{>type-subtype-operationtype=../typesub_type=../sub_typeoperation=this}}{{! This one’s playing along nicely }}{{>imageimage=imagealt=title}}
Optimized: Partials works nicely, unless they’re invoked from a template that is in turn invoked from
_.map
.Unoptimized: Partials works no matter the context they’re in.
Am I supposed to bind my compiled template somehow, and if so, to what context?
Example given below
view.js
accepted-sources-template.hbs
The text was updated successfully, but these errors were encountered: