javascript - Underscore.js _.partial with _ as argument not working -
I am using backcon and underscore. According to the document of Underscore.js, you can pass _ _ in your list of logic for a logic of _ partial (function, * args)
function:
To specify that should not be filled with the first, but left to the call-time supply to the open.
Anyone have a working example of this? I am making a partial call within such a scene:
this.filterCollection = _.partial (filterFn, _, SEARCHTERM);
Where FilterFn looks like this:
function (license, key) {var organization; Organization = app.organizations.get (license.get ('organization_id')); If (license.isNew ()) {return true; // Always include new models in search} Other {Return (Organization & amp; Organization .get ('name'). Index (key)! == -1); }}
I am calling this in keeping with this in mind:
this.filterCollection (model)
The filter crashes on the phone line: organization = app.organizations.get (license.get ('organization_id'));
Because License
has no way to get
.
It seems they just added the option to use _
Comments
Post a Comment