|
5 | 5 | * @restrict E |
6 | 6 | * @description |
7 | 7 | * |
8 | | - * Menu bars are containers that hold multiple menus. They change the behavior and appearence |
| 8 | + * Menu bars are containers that hold multiple menus. They change the behavior and appearance |
9 | 9 | * of the `md-menu` directive to behave similar to an operating system provided menu. |
10 | 10 | * |
11 | 11 | * @usage |
|
42 | 42 | * |
43 | 43 | * ## Menu Bar Controls |
44 | 44 | * |
45 | | - * You may place `md-menu-items` that function as controls within menu bars. |
| 45 | + * You may place `md-menu-item`s that function as controls within menu bars. |
46 | 46 | * There are two modes that are exposed via the `type` attribute of the `md-menu-item`. |
47 | 47 | * `type="checkbox"` will function as a boolean control for the `ng-model` attribute of the |
48 | 48 | * `md-menu-item`. `type="radio"` will function like a radio button, setting the `ngModel` |
49 | 49 | * to the `string` value of the `value` attribute. If you need non-string values, you can use |
50 | | - * `ng-value` to provide an expression (this is similar to how angular's native `input[type=radio]` works. |
| 50 | + * `ng-value` to provide an expression (this is similar to how angular's native `input[type=radio]` |
| 51 | + * works. |
| 52 | + * |
| 53 | + * If you want either to disable closing the opened menu when clicked, you can add the |
| 54 | + * `md-prevent-menu-close` attribute to the `md-menu-item`. The attribute will be forwarded to the |
| 55 | + * `button` element that is generated. |
51 | 56 | * |
52 | 57 | * <hljs lang="html"> |
53 | 58 | * <md-menu-bar> |
|
56 | 61 | * Sample Menu |
57 | 62 | * </button> |
58 | 63 | * <md-menu-content> |
59 | | - * <md-menu-item type="checkbox" ng-model="settings.allowChanges">Allow changes</md-menu-item> |
| 64 | + * <md-menu-item type="checkbox" ng-model="settings.allowChanges" md-prevent-menu-close> |
| 65 | + * Allow changes |
| 66 | + * </md-menu-item> |
60 | 67 | * <md-menu-divider></md-menu-divider> |
61 | 68 | * <md-menu-item type="radio" ng-model="settings.mode" ng-value="1">Mode 1</md-menu-item> |
62 | | - * <md-menu-item type="radio" ng-model="settings.mode" ng-value="1">Mode 2</md-menu-item> |
63 | | - * <md-menu-item type="radio" ng-model="settings.mode" ng-value="1">Mode 3</md-menu-item> |
| 69 | + * <md-menu-item type="radio" ng-model="settings.mode" ng-value="2">Mode 2</md-menu-item> |
| 70 | + * <md-menu-item type="radio" ng-model="settings.mode" ng-value="3">Mode 3</md-menu-item> |
64 | 71 | * </md-menu-content> |
65 | 72 | * </md-menu> |
66 | 73 | * </md-menu-bar> |
|
0 commit comments