我是AngularJs材料的初学者,我想打开一个“mdbottomsheet”'并在此工作表中放置一个按钮,当单击按钮时,打开另一个“mdbottomsheet”'结束,没有关闭第一个“mdbottomsheet”。
有HTML代码:
<div ng-controller="MyController">
<md-button ng-click="openBottomSheet()">
Open a Bottom Sheet!
</md-button>
</div>
有Js:
var app = angular.module('app', ['ngMaterial']);
app.controller('MyController', function($scope, $mdBottomSheet) {
$scope.openBottomSheet = function() {
$mdBottomSheet.show({
controller: 'BottomSheet',
template: '<md-bottom-sheet>Hello!
<md-button ng-click="openSecondBottomSheet()">
Open Second Bottom Sheet!
</md-button></md-bottom-sheet>'
});
};
});
并在&#39; BottomSheet&#39;控制器:
var app = angular.module('app', ['ngMaterial']);
app.controller('BottomSheet', function($scope, $mdBottomSheet) {
$scope.openSecondBottomSheet = function() {
$mdBottomSheet.show({
controller: 'SecondBottomSheet',
template: '<md-bottom-sheet>Hello!</md-bottom-sheet>'
});
};
});
这是我的代码,它可以工作但是当SecondBottomSheet&#39;打开,第一个&#39; BottomSheet&#39;关闭!我想打开&#39; SecondBottomSheet&#39;在第一个&#39; BottomSheet&#39;!