- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图在单击图标时生成对话。单击 md-icon
时出现以下错误.对话框打开,但我在控制台上看到以下错误:
TypeError: Cannot read property 'getBoundingClientRect' of undefined
at transformToClickElement (angular-material.js:4652)
at dialogPopIn (angular-material.js:4630)
at Object.onShow (angular-material.js:4538)
at InterimElementFactory.self.show.compilePromise.then.showDone (angular-material.js:1827)
at processQueue (angular.js:13248)
at angular.js:13264
at Scope.$get.Scope.$eval (angular.js:14466)
at Scope.$get.Scope.$digest (angular.js:14282)
at Scope.$get.Scope.$apply (angular.js:14571)
at done (angular.js:9698)
angular-material.js:824 Uncaught TypeError: Cannot read property 'hasAttribute' of undefined
<md-button class="md-fab md-primary" ng-click="showAdvanced($event)"
aria-label="AddClient">
<md-icon md-svg-src="content/images/68448.svg"
style="width: 48px; height: 48px;">
</md-icon>
<md-tooltip md-visible="demo.showTooltip">
Add Client
</md-tooltip>
</md-button>
$scope.showAdvanced = function(ev) {
$mdDialog.show({
controller: 'newClient',
templateUrl: 'app/views/xyz/newClient.html',
targetEvent: ev
});};
<md-content class="md-padding" layout="row" layout-sm="column" style="font-size:1.2em">
<form name="myForm" >
<div layout layout-sm="column">
<md-input-container style="width:80%">
<label>Name</label>
<input ng-model="create.Name">
</md-input-container>
</div>
</md-content>
最佳答案
您缺少包装 md-dialog 标签。根据文档:
The dialog's template must have an outer md-dialog element. Inside, use an md-content element for the dialog's content, and use an element with class md-actions for the dialog's actions.
<md-dialog>
<md-content>
<md-button class="md-fab md-primary" ng-click="showAdvanced($event)" aria-label="AddClient">
<md-icon md-svg-src="content/images/68448.svg" style="width: 48px; height: 48px;"></md-icon>
<md-tooltip md-visible="demo.showTooltip">
Add Client
</md-tooltip>
</md-button>
</md-content>
</md-dialog>
关于angularjs - $mdDialog 打开但出现以下错误。无法读取属性 'getBoundingClientRect',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29436262/
this.$mdDialog.show({ controllerAs: 'ctrl', resolve: { product: product }, c
我要关闭$mdDialog成功 promise 返回后。 我可以像下面的代码一样关闭 $mdDialog 但它不能满足我的这个目的 vm.$mdDialog.show({ controller
在关闭 $mdDialog 后,我试图通过使用他的点击事件来调用文件输入时遇到了一个奇怪的行为。 当我在不使用 $mdDialog 的情况下调用点击事件时,一切正常,但与对话框一起使用时,上传文件选择
我正在尝试将表单输入传递到我的对话框(例如作为标题)。问题是:它没有得到 $scope 的形式。 如果我设置 $scope sinde Controller ,它将正常显示(例如,参见 $scope.
我正在尝试将 Ng-repeat 传递给我的 $mdDialog 但没有找到太多有关如何执行此操作的文档。我一直指的是This Stack ,但我没有运气将图像传递给模态。 在控制台中我收到一条错误消
我目前正在尝试在我的一个单元测试中打开和关闭 Angular Material 2 对话框。打开看起来不错,但我监视了一个应该在关闭后调用的函数,但它从未被调用过,我认为这是因为对话框没有按我希望的那
所以我尝试使用 MdDialog 来显示错误消息。不幸的是,它不是以弹出窗口的形式出现,而是以页面底部的 block 形式出现。 我需要查看或更改什么才能使其正常工作? 下面的代码 common-mo
主列表页面有编辑按钮。这会打开已编辑行的详细信息。 Way-1:现在,如果我设置“ctrl.parent.q_details.client_location”,它会与父列表 Controller 绑定
我在应用程序中使用$ mdDialog,但想将其用作“确认”对话框而不是普通对话框。这意味着,在用户单击“确认”对话框中的两个按钮之一之前,不应继续执行代码流。我注意到可以使用$ mdDialog.c
我想在 mdDiaglog 的 .textcontent 中添加换行符。 以下是我的代码: var confirm = $mdDialog.confirm() .title('Refr
我使用完美运行的“locals”属性向我的 md-Dialog 发送了一些信息。 用户按下按钮后,他将通过 $resource 方法发送一些信息并获得响应。我需要在 md 对话框关闭后显示该响应。 如
如何在 $mdDialog 中添加表单以及提交时如何发送到电子邮件。我试图从对话框中获取信息,但找不到任何线索。 我的 Controller 是: App.controller('MainContro
通常,您可能会显示一个带有 Angular Material 的对话框,如下所示: $mdDialog.show({ controller: FooCtrl, templateUrl:
你好,我正在尝试将一个简单的 md 对话框外部区域的颜色从深色透明颜色更改为不同的颜色,它可以更暗或更亮,这可能吗?感谢您的帮助! 代码来自 https://material.angularjs.or
我正在尝试使用 $mdDialog 将值从 Controller 传递到服务。 var id 有值,但是当我转到 testService 时,该值不存在。 module.controller('vie
我使用模态选项卡,我有通知弹出窗口,当用户登录我的应用程序时,它总是显示给用户。它包含用户离线时发生的所有事件。问题是当我单击列表中的任何对象时,它会关闭我的弹出窗口并显示新的模式选项卡。 我想实现这
我目前有一个 $mdDialog,当它打开时是整页并且其中有一个表单。当用户单击取消时,$mdDialog 将通过调用此函数关闭 $mdDialog.cancel(); 但是,我还想在用户单击浏览器后
我想向我的 mdDialog 添加一个变量或函数。我不确定如何创建自定义 mdDialog,我是 angularjs 的新手。 这是我的 mdDialog: vm.dialog_up = functi
我有一个带有登录页面的 Angular 应用程序,该页面应该在处理请求时显示加载对话框。如果后端登录成功,就没有问题,我会被转到内容页面。不幸的是,如果登录失败,加载对话框永远不会隐藏。 这是我的代码
有没有办法让两个 mdDialog 框一个在另一个上面打开,或者一个来自在 Angular Material 设计实现中另一个内部触发的事件?我正在实现的当前场景是一个 mdDialog 在单击时打开
我是一名优秀的程序员,十分优秀!