I'm using the full, Linked In version 1.2.0 of dust.js and am trying to define a filter for use when rendering a JSON view with a dust template. When I include this line in the page script:
_.extend(dust.filters, {foo: function(value){ return 'foo'; }});
it results in this error in Chrome's debugger:
Uncaught ReferenceError: _ is not defined
If I add the filter definition to where the other filters are in the dust .js file, it works. What am I doing wrong?
It looks like the file that defines the new filter is being run before underscore ( _ ) is being run. Thus, underscore is undefined.