Writing a jquery plugin in coffeescript - how to get "(function($)" and "(jQuery)"?

Posted by PandaWood on Stack Overflow See other posts from Stack Overflow or by PandaWood
Published on 2010-12-26T12:43:12Z Indexed on 2010/12/26 12:54 UTC
Read the original article Hit count: 172

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery