AngularJS - BottomSheet 不工作。 "is not a function"

AngularJS - BottomSheet not working. "is not a function"

我在使用 openBottomSheet API 时遇到一些困难。

这是我的HTML:

<md-button aria-label="Open Settings" ng-click="openBottomSheet($event)">
   <ng-md-icon icon="more_vert"></ng-md-icon>
</md-button>

这会在我的控制器中打开 openBottomSheet,如下所示:

$scope.openBottomSheet = function() {
    $mdBottomSheet.show({
        template: '<md-bottom-sheet>' +
        'Hello! <md-button ng-click="closeBottomSheet()">Close</md-button>' +
        '</md-bottom-sheet>'
    })
    // Fires when the hide() method is used
        .then(function() {
            console.log('You clicked the button to close the bottom sheet!');
        })
        // Fires when the cancel() method is used
        .catch(function() {
            console.log('You hit escape or clicked the backdrop to close.');
        });
};
$scope.closeBottomSheet = function($scope, $mdBottomSheet) {
    $mdBottomSheet.hide();
}

这是基于文档,为什么我不能在我的项目中使用它?

控制器注入:

.controller('containerCtrl', ['$scope', '$rootScope', '$stateParams', '$http', '_', '$q', '$state', '$mdBottomSheet','$mdSidenav', function ($scope, $rootScope, $stateParams, $http, $q, $state,$mdBottomSheet,$mdSidenav) {

这是我的错误:

main.min.js:3 TypeError: c.show is not a function

 `c.show` is this line in controller: `$mdBottomSheet.show({` (minified version)

删除控制器注入中的-。字符串数组注入和服务注入应该相同且顺序相同。

.controller('containerCtrl', ['$scope', '$rootScope', '$stateParams', '$http',  '$q', '$state', '$mdBottomSheet','$mdSidenav', 
function ($scope, $rootScope, $stateParams, $http, $q, $state,$mdBottomSheet,$mdSidenav) {