使用底片时出现错误
div(flex="15" data-ng-click="showGridBottomSheet(testExecution)" class="link-style")
以下是被调用函数
$scope.showGridBottomSheet = function(obj) {
testexecutionServices.testexeustionObj = obj;
$mdBottomSheet.show({
scope: $scope,
targetEvent: $event,
preserveScope: true,
templateUrl: 'testexecutions/testExecutionResult',
controller: 'testexecutionCtrl'
}).then(function(clickedItem) {
}, function() {});
};
答案 0 :(得分:0)
我认为您需要在函数参数中添加$event
,如下所示:
$scope.showGridBottomSheet = function(obj, $event) {
testexecutionServices.testexeustionObj = obj;
$mdBottomSheet.show({
scope: $scope,
targetEvent: $event,
preserveScope: true,
templateUrl: 'testexecutions/testExecutionResult',
controller: 'testexecutionCtrl'
}).then(function(clickedItem) {
}, function() {});
};
并在您的HTML中,将$event
传递给函数调用:
div(flex="15" data-ng-click="showGridBottomSheet(testExecution,$event)" class="link-style")
如果您不使用它,请将其设置为null
。