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/)
59
60
* - [val()](http://api.jquery.com/val/)
60
61
* - [wrap()](http://api.jquery.com/wrap/)
61
62
*
62
- * ## In addtion to the above, Angular provides additional methods to both jQuery and jQuery lite:
63
+ * ## jQuery/jqLite Extras
64
+ * Angular also provides the following additional methods and events to both jQuery and jqLite:
63
65
*
66
+ * ### Events
67
+ * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event
68
+ * on all DOM nodes being removed. This can be used to clean up and 3rd party bindings to the DOM
69
+ * element before it is removed.
70
+ * ### Methods
64
71
* - `controller(name)` - retrieves the controller of the current element or its parent. By default
65
72
* retrieves controller associated with the `ngController` directive. If `name` is provided as
66
73
* camelCase directive name, then the controller for this directive will be retrieved (e.g.
Original file line number Diff line number Diff line change @@ -446,6 +446,9 @@ function $RootScopeProvider(){
446
446
*
447
447
* @description
448
448
* Broadcasted when a scope and its children are being destroyed.
449
+ *
450
+ * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
451
+ * clean up DOM bindings before an element is removed from the DOM.
449
452
*/
450
453
451
454
/**
@@ -467,6 +470,9 @@ function $RootScopeProvider(){
467
470
* Just before a scope is destroyed a `$destroy` event is broadcasted on this scope.
468
471
* Application code can register a `$destroy` event handler that will give it chance to
469
472
* perform any necessary cleanup.
473
+ *
474
+ * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
475
+ * clean up DOM bindings before an element is removed from the DOM.
470
476
*/
471
477
$destroy : function ( ) {
472
478
// 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