File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 26
26
* Note: All element references in Angular are always wrapped with jQuery or jqLite; they are never
27
27
* raw DOM references.
28
28
*
29
- * ## Angular's jQuery lite provides the following methods:
29
+ * ## Angular's jqLite
30
+ * Angular's lite version of jQuery provides only the following jQuery methods:
30
31
*
31
32
* - [addClass()](http://api.jquery.com/addClass/)
32
33
* - [after()](http://api.jquery.com/after/)
61
62
* - [val()](http://api.jquery.com/val/)
62
63
* - [wrap()](http://api.jquery.com/wrap/)
63
64
*
64
- * ## In addition to the above, Angular provides additional methods to both jQuery and jQuery lite:
65
+ * ## jQuery/jqLite Extras
66
+ * Angular also provides the following additional methods and events to both jQuery and jqLite:
65
67
*
68
+ * ### Events
69
+ * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event
70
+ * on all DOM nodes being removed. This can be used to clean up and 3rd party bindings to the DOM
71
+ * element before it is removed.
72
+ * ### Methods
66
73
* - `controller(name)` - retrieves the controller of the current element or its parent. By default
67
74
* retrieves controller associated with the `ngController` directive. If `name` is provided as
68
75
* camelCase directive name, then the controller for this directive will be retrieved (e.g.
Original file line number Diff line number Diff line change @@ -575,6 +575,9 @@ function $RootScopeProvider(){
575
575
*
576
576
* @description
577
577
* Broadcasted when a scope and its children are being destroyed.
578
+ *
579
+ * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
580
+ * clean up DOM bindings before an element is removed from the DOM.
578
581
*/
579
582
580
583
/**
@@ -596,6 +599,9 @@ function $RootScopeProvider(){
596
599
* Just before a scope is destroyed a `$destroy` event is broadcasted on this scope.
597
600
* Application code can register a `$destroy` event handler that will give it chance to
598
601
* perform any necessary cleanup.
602
+ *
603
+ * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
604
+ * clean up DOM bindings before an element is removed from the DOM.
599
605
*/
600
606
$destroy : function ( ) {
601
607
// we can't destroy the root scope or a scope that has been already destroyed
You can’t perform that action at this time.
0 commit comments