📅  最后修改于: 2020-10-28 04:57:23             🧑  作者: Mango
$ mdBottomSheet是一种Angular服务,用于在应用程序上打开底页,并提供一个简单的promise API。
S.N |
Method & Description |
1 |
$mdBottomSheet.show(options);
Show a bottom sheet with the specified options.
S.N |
Parameter & Description |
1 |
* options
An options object, with the following properties −
-
templateUrl – {string=} − The url of an html template file that will be used as the content of the bottom sheet. Restrictions: the template must have an outer md-bottom-sheet element.
-
template – {string=} − Same as templateUrl, except this is an actual template string.
-
scope – {object=} − The scope to link the template / controller to. If none is specified, it will create a new child scope. This scope will be destroyed when the bottom sheet is removed unless preserveScope is set to true.
-
preserveScope – {boolean=} − It dictates whether to preserve the scope when the element is removed. By default, it is false.
-
controller – {string=} − The controller to associate with this bottom sheet.
-
locals – {string=} − An object containing key/value pairs. The keys will be used as names of values to inject into the controller. For example, locals: {three: 3} will inject three into the controller with the value of 3.
-
clickOutsideToClose – {boolean=} − It dictates whether the user can click outside the bottom sheet to close it. By default, it is true.
escapeToClose – {boolean=}: It dictates whether the user can press escape to close the bottom sheet. By default, it is true.
-
resolve – {object=} − Similar to locals, except that it takes promises as values and the bottom sheet will not open until the promises resolve.
controllerAs – {string=}: An alias to assign the controller to on the scope.
-
parent – {element=} − The element to append the bottom sheet to. The parent may be a function, string, object, or null. Defaults to appending to the body of the root element (or the root element) of the application. e.g. angular.element(document.getElementById(‘content’)) or “#content”.
-
disableParentScroll – {boolean=} − Whether to disable scrolling while the bottom sheet is open. Default true.
|
Sr.No |
Returns & Description |
1 |
promise
A promise that can be resolved with $mdBottomSheet.hide() or rejected with $mdBottomSheet.cancel().
|
|
例
以下示例显示了$ mdBottomSheet服务的用法以及底页的用法。
am_bottomsheet.htm
结果
验证结果。