File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1
1
import Ember from 'ember' ;
2
2
3
+ /**
4
+ The `{{did-insert}}` element modifier is activated when an element is
5
+ inserted into the DOM.
6
+
7
+ In this example, the `fadeIn` function receives the `div` DOM element as its
8
+ first argument and is executed after the element is inserted into the DOM.
9
+
10
+ ```handlebars
11
+ <div {{did-insert this.fadeIn}} class="alert">
12
+ {{yield}}
13
+ </div>
14
+ ```
15
+
16
+ ```js
17
+ export default Component.extend({
18
+ fadeIn(element) {
19
+ element.classList.add('fade-in');
20
+ }
21
+ });
22
+ ```
23
+
24
+ By default, the executed function won't be bound. If you would like to access
25
+ the component context in your function, use the `action` helper as follows:
26
+
27
+ ```handlebars
28
+ <div {{did-insert (action this.fadeIn)}} class="alert">
29
+ {{yield}}
30
+ </div>
31
+ ```
32
+
33
+ @method did-insert
34
+ @public
35
+ */
3
36
export default Ember . _setModifierManager (
4
37
( ) => ( {
5
38
createModifier ( ) { } ,
You can’t perform that action at this time.
0 commit comments