mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Merge pull request #1888 from joliss/fat-arrow-doc
Document fat arrow in class definitions.
This commit is contained in:
commit
b9c17cab3c
1 changed files with 6 additions and 1 deletions
|
|
@ -780,10 +780,15 @@ Expressions
|
|||
</p>
|
||||
<%= code_for('fat_arrow') %>
|
||||
<p>
|
||||
If we had used <tt>-></tt> in the callback above, <tt>@customer</tt> would
|
||||
If we had used <tt>-></tt> in the callback above, <tt>@customer</tt> would
|
||||
have referred to the undefined "customer" property of the DOM element,
|
||||
and trying to call <tt>purchase()</tt> on it would have raised an exception.
|
||||
</p>
|
||||
<p>
|
||||
When used in a class definition, methods declared with the fat arrow will
|
||||
be automatically bound to each instance of the class when the instance is
|
||||
constructed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span id="embedded" class="bookmark"></span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue