- Angular Material 教程
- Angular Material - 首页
- Angular Material - 概述
- 环境搭建
- Angular Material - 自动完成
- Angular Material - 底部菜单
- Angular Material - 卡片
- Angular Material - 小部件
- Angular Material - 布局
- Angular Material - 输入控件
- Angular Material - 图标
- Angular Material - 网格
- Angular Material - 侧边导航栏
- Angular Material - 浮动操作按钮快速拨号盘
- Angular Material - 副标题
- Angular Material - 滑动
- Angular Material - 开关
- Angular Material - 主题
- Angular Material - 提示信息
- Angular Material - 排版
- Angular Material - 虚拟滚动
- Angular Material - 白框
- Angular Material 有用资源
- Angular Material - 快速指南
- Angular Material - 有用资源
- Angular Material - 讨论
Angular Material - 底部菜单
$mdBottomSheet 是一个 Angular 服务,用于在应用程序上打开底部菜单,并提供简单的 Promise API。
序号 | 方法和描述 | ||||||||
---|---|---|---|---|---|---|---|---|---|
1 | $mdBottomSheet.show(options); 使用指定的选项显示底部菜单。
|
示例
以下示例显示了 $mdBottomSheet 服务和底部菜单的使用。
am_bottomsheet.htm
<html lang = "en"> <head> <link rel = "stylesheet" href = "https://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.css"> <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-animate.min.js"></script> <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-aria.min.js"></script> <script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-messages.min.js"></script> <script src = "https://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.js"></script> <script language = "javascript"> angular .module('firstApplication', ['ngMaterial']) .controller('bottomSheetController', bottomSheetController); function bottomSheetController ($scope, $mdBottomSheet) { $scope.openBottomSheet = function() { $mdBottomSheet.show ({ template: '<md-bottom-sheet>Learn <b>Angular Material</b> @ TutorialsPoint.com!</md-bottom-sheet>' }); }; } </script> </head> <body ng-app = "firstApplication"> <div ng-controller = "bottomSheetController as ctrl" layout = "column"> <md-content class = "md-padding"> <form ng-submit = "$event.preventDefault()"> <md-button class = "md-raised md-primary" ng-click = "openBottomSheet()"> Open Bottom Sheet! </md-button> </form> </md-content> </div> </body> </html>
结果
验证结果。