у меня Left_template_view_html
и center_template_view_html
При нажатии md-button
в Left_template_view_html
Пытаюсь открыть mdDialog
на document.body
что я должен предоставить родителю: angular.element()
?
В приведенном ниже коде, чтобы избежать ошибки консоли. Функциональность у меня отлично работает.
$scope.showAdvancedSelection = function(ev,templateURL) {
$mdDialog.show({
controller: DialogController,
template: templateURL,
parent: angular.element(document.getElementById(document.body)),
targetEvent: ev,
clickOutsideToClose: true
})
.then(function (answer) {
$scope.status = 'true';
}, function () {
$scope.status = 'You cancelled the dialog.';
});
};
ошибка
angular.js: 14525 TypeError: Невозможно прочитать свойство 'element' из null
при f (angular-material.min.js: 16)
при angular-material.min.js: 16
at angular.js: 16832
в дайджесте $ (angular.js: 17971)
в м. $ применяются (angular.js: 18269)
при l (angular.js: 12387)
at XMLHttpRequest.A.onload (angular.js: 12541) "Возможно необработанное отклонение: {}"