-
Notifications
You must be signed in to change notification settings - Fork 200
Open
Description
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)
{
return Marionette.ItemView.extend(
{
template: Template,
setAcceptedSources: function()
{
// This here doesn’t work when code has been optimized
var acceptedSources = _.chain(this.wrapper.sources)
.map(AcceptedSourcesTemplate)
.compact()
.value()
.join(',');
this.$el.trigger('droppable:options:set', { accept: acceptedSources });
}
});
}
);accepted-sources-template.hbs
{{~#each operations~}}
#panel-right .aggregate[data-source*="{{>type-sub-type-operation type=../type sub_type=../sub_type operation=this}}"] > div,#panel-right .results[data-source*="{{>type-sub-type-operation type=../type sub_type=../sub_type operation=this}}"] > ol > li{{~#unless @last~}},{{~/unless~}}
{{~/each~}}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels