Angular Material - 底部工作表
$mdBottomSheet 是一项 Angular 服务,用于在应用程序上打开底部工作表并提供简单的 Promise API。
S.N | 方法 & 描述 | ||||||||
---|---|---|---|---|---|---|---|---|---|
1 | $mdBottomSheet.show(options); 显示具有指定选项的底部工作表。
|
示例
以下示例展示了 $mdBottomSheet 服务的使用以及底部工作表的使用。
am_bottomsheet.html
<html lang = "en"> <head> <link rel = "stylesheet" href = "https://www.w3ccoo.com/lib/angular_material/1.0.0/angular-material.min.css"> <script src = "https://cdn.staticfile.org/angular.js/1.4.8/angular.min.js"></script> <script src = "https://cdn.staticfile.org/angular.js/1.4.8/angular-animate.min.js"></script> <script src = "https://cdn.staticfile.org/angular.js/1.4.8/angular-aria.min.js"></script> <script src = "https://cdn.staticfile.org/angular.js/1.4.8/angular-messages.min.js"></script> <script src = "https://www.w3ccoo.com/lib/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> @ www.w3ccoo.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>
结果
验证结果。