You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 29, 2019. It is now read-only.
Sets the [`aria-describedby`](https://www.w3.org/TR/wai-aria/states_and_properties#aria-describedby) property on the modal. The value should be an id (without the leading `#`) pointing to the element that describes your modal. Typically, this will be the text on your modal, but does not include something the user would interact with, like buttons or a form. Omitting this option will not impact sighted users but will weaken your accessibility support.
21
21
22
-
*`ariaLabelledBy`
22
+
*`ariaLabelledBy`
23
23
_(Type: `string`, `my-modal-title`)_ -
24
24
Sets the [`aria-labelledby`](https://www.w3.org/TR/wai-aria/states_and_properties#aria-labelledby) property on the modal. The value should be an id (without the leading `#`) pointing to the element that labels your modal. Typically, this will be a header element. Omitting this option will not impact sighted users but will weaken your accessibility support.
25
-
25
+
26
26
*`backdrop`
27
27
_(Type: `boolean|string`, Default: `true`)_ -
28
28
Controls presence of a backdrop. Allowed values: `true` (default), `false` (no backdrop), `'static'` (disables modal closing by click on the backdrop).
29
-
29
+
30
30
*`backdropClass`
31
31
_(Type: `string`)_ -
32
32
Additional CSS class(es) to be added to a modal backdrop template.
@@ -35,15 +35,29 @@ The `$uibModal` service has only one method: `open(options)`.
35
35
_(Type: `boolean`, Default: `false`)_ -
36
36
When used with `controllerAs` & set to `true`, it will bind the $scope properties onto the controller.
37
37
38
+
*`component`
39
+
_(Type: `string`, Example: `myComponent`)_ -
40
+
A string reference to the component to be rendered that is registered with Angular's compiler. If using a directive, the directive must have `restrict: 'E'` and a template or templateUrl set.
41
+
42
+
It supports these bindings:
43
+
44
+
*`close` - A method that can be used to close a modal, passing a result. The result must be passed in this format: `{$value: myResult}`
45
+
46
+
*`dismiss` - A method that can be used to dismiss a modal, passing a result. The result must be passed in this format: `{$value: myRejectedResult}`
47
+
48
+
*`modalInstance` - The modal instance. This is the same `$uibModalInstance` injectable found when using `controller`.
49
+
50
+
*`resolve` - An object of the modal resolve values. See [UI Router resolves](#ui-router-resolves) for details.
A controller for the modal instance, either a controller name as a string, or an inline controller function, optionally wrapped in array notation for dependency injection. Allows the controller-as syntax. Has a special `$uibModalInstance` injectable to access the modal instance.
41
55
42
56
*`controllerAs`
43
-
_(Type: `string`, Example: `ctrl`)_ -
57
+
_(Type: `string`, Example: `ctrl`)_ -
44
58
An alternative to the controller-as syntax. Requires the `controller` option to be provided as well.
45
59
46
-
*`keyboard` -
60
+
*`keyboard` -
47
61
_(Type: `boolean`, Default: `true`)_ -
48
62
Indicates whether the dialog should be closable by hitting the ESC key.
49
63
@@ -84,7 +98,7 @@ The `$uibModal` service has only one method: `open(options)`.
84
98
CSS class(es) to be added to the top modal window.
85
99
86
100
Global defaults may be set for `$uibModal` via `$uibModalProvider.options`.
87
-
101
+
88
102
#### return
89
103
90
104
The `open` method returns a modal instance, an object with the following properties:
@@ -111,8 +125,8 @@ The `open` method returns a modal instance, an object with the following propert
111
125
112
126
*`rendered`
113
127
_(Type: `promise`)_ -
114
-
Is resolved when a modal is rendered.
115
-
128
+
Is resolved when a modal is rendered.
129
+
116
130
---
117
131
118
132
The scope associated with modal's content is augmented with:
@@ -133,9 +147,9 @@ Also, when using `bindToController`, you can define an `$onInit` method in the c
133
147
134
148
Events fired:
135
149
136
-
*`$uibUnscheduledDestruction` -
150
+
*`$uibUnscheduledDestruction` -
137
151
This event is fired if the $scope is destroyed via unexpected mechanism, such as it being passed in the modal options and a $route/$state transition occurs. The modal will also be dismissed.
138
-
152
+
139
153
*`modal.closing` -
140
154
This event is broadcast to the modal scope before the modal closes. If the listener calls preventDefault() on the event, then the modal will remain open.
141
155
Also, the `$close` and `$dismiss` methods returns true if the event was executed. This event also includes a parameter for the result/reason and a boolean that indicates whether the modal is being closed (true) or dismissed.
@@ -144,4 +158,4 @@ Events fired:
144
158
145
159
If one wants to have the modal resolve using [UI Router's](https://github.com/angular-ui/ui-router) pre-1.0 resolve mechanism, one can call `$uibResolve.setResolver('$resolve')` in the configuration phase of the application. One can also provide a custom resolver as well, as long as the signature conforms to UI Router's [$resolve](http://angular-ui.github.io/ui-router/site/#/api/ui.router.util.$resolve).
146
160
147
-
When the modal is opened with a controller, a `$resolve` object is exposed on the template with the resolved values from the resolve object.
161
+
When the modal is opened with a controller, a `$resolve` object is exposed on the template with the resolved values from the resolve object. If using the component option, see details on how to access this object in component section of the modal documentation.
0 commit comments