@@ -2,14 +2,56 @@ angular
2
2
. module ( 'material.components.menu' )
3
3
. provider ( '$mdMenu' , MenuProvider ) ;
4
4
5
+ /** Handles behavior for a menu while it is open, including:
6
+ *
7
+ * - handling animating the menu opening/closing
8
+ * - handling key/mouse events on the menu element
9
+ * - handling enabling/disabling scroll while the menu is open
10
+ * - handling redrawing during resizes and orientation changes
11
+ */
12
+
13
+ /**
14
+ * @ngdoc service
15
+ * @name $mdMenu
16
+ * @module material.components.menu
17
+ *
18
+ * @description
19
+ * `$mdMenu` is a service that is available within the scope of an `md-menu` directive.
20
+ *
21
+ * ## Usage
22
+ *
23
+ * <hljs lang="html">
24
+ * <md-menu>
25
+ * <!--Clicking the button will open the menu-->
26
+ * <md-button ng-click="$mdMenu.open($event)">
27
+ * Open
28
+ * </md-button>
29
+ * <!--Moving the mouse off will close the menu-->
30
+ * <md-menu-content ng-mouseleave="$mdMenu.close()">
31
+ * <md-menu-item>
32
+ * <md-button ng-click="$mdMenu.close()">Clicking me will also close the menu</md-button>
33
+ * </md-menu-item>
34
+ * </md-menu-content>
35
+ * </md-menu>
36
+ * </hljs>
37
+ */
38
+
39
+ /**
40
+ * @ngdoc method
41
+ * @name $mdMenu#open
42
+ * @param {$event } $event By passing $event as argument, the corresponding event is stopped from propagating up the
43
+ * DOM-tree
44
+ *
45
+ * @description
46
+ * Opens the menu within the `md-menu` scope
47
+ */
48
+
5
49
/**
6
- * Interim element provider for the menu.
7
- * Handles behavior for a menu while it is open, including:
8
- * - handling animating the menu opening/closing
9
- * - handling key/mouse events on the menu element
10
- * - handling enabling/disabling scroll while the menu is open
11
- * - handling redrawing during resizes and orientation changes
50
+ * @ngdoc method
51
+ * @name $mdMenu#close
12
52
*
53
+ * @description
54
+ * Closes the menu within the `md-menu` scope
13
55
*/
14
56
15
57
function MenuProvider ( $$interimElementProvider ) {
0 commit comments