Writing a jquery plugin in coffeescript - how to get "(function($)" and "(jQuery)"?
- by PandaWood
I am writing a jquery plugin in coffeescript but am not sure how to get the function wrapper part right.
My coffeescript starts with this line:
$.fn.extend({
Which creates the javascript with a function wrapper:
(function() {
$.fn.extend({
but I want a '$' passed in like this:
(function($) {
$.fn.extend({
Similar for the ending I have... nothing in particular in coffeescript.
I get this in javascript:
})();
But would like this:
})(jQuery);
Does anyone know how to achieve this with the coffeescript compiler?
Or what is the best way to get this done within coffeescript?