【问题标题】:Open bottom sheet inside a div在 div 中打开底页
【发布时间】:2018-07-16 16:52:56
【问题描述】:

我想在 div 中打开一个底页。我能够让它工作,但它填满了整个页面。

$scope.showListBottomSheet = function() {

        $scope.alert = '';
        $mdBottomSheet.show({
            templateUrl: 'template/newCountryForm.html',
            controller: 'Ctrl1'
        }).then(function(clickedItem) {
            $scope.alert = clickedItem['name'] + ' clicked!';
        }).catch(function(error) {
            // User clicked outside or hit escape
        });
    };

我希望它只填充 红色 部分,我不知道该怎么做

【问题讨论】:

  • 分享一个plunkr,以便我们提供一些具体的解决方案

标签: javascript angularjs angularjs-material


【解决方案1】:

原来我只需要在

中添加键“父”
var parentEl = angular.element(document.querySelector('.red'));
$mdBottomSheet.show({
     parent: parentEl,
     templateUrl: 'template/newCountryForm.html',
     controller: 'Ctrl1'
 })

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-11-28
    • 2020-12-22
    • 2014-10-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多