问题标签 [angular-material-7]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
angular - 角度 matdatepicker 打印错误的日期
我正在使用matDatePicker
这种方式:
在我的 .ts 中,我声明:
在我决定在日期选择器中添加默认显示值之前,它一直正常工作。我所做的是[(ngModel)]="dal_default"
在input
标签内添加,并在 .ts 文件中进行初始化dal_default
:
现在,如果我尝试使用 formControlName 或此dal_default
变量打印 Date 的值,我会得到一个奇怪的格式字符串。特别是,如果我打印显示的默认日期,它会正确打印为日期,但是如果我更改日期,我会得到一个字符串(我相信它代表毫秒?)。例如,以下是我从日期 12/12/2018 得到的:
我所做的唯一另一件事是将内部的日期格式更改为app.module.ts
DD/MM/YYYY 格式的日期:
和内部提供者:
matdatepicker 以我想要的格式正确显示日期。我不相信这是问题所在,但不能 100% 确定。
问题是什么?
angular - 如何以编程方式滚动 MatDialogContent?
我有一个MatDialog
(with MatDialogContent
),它比屏幕大,所以会出现竖线。在不成功的提交和所有表单的字段重新验证之后,我想有条件地滚动到该对话框的底部,以显示MatError
给用户。如何做到这一点?
angular - Is it possible to apply a conditional pipe which itself contains a condition?
I have a dropdown (input + autocomplete) where I can type a string or select an object from the dropdown list. I want to use the pipe only when the value in the input is of type string. If user selects a value from dropdown, I need to remove the custom pipe.
I want to apply the custom pipe the typeof option.name is String. and to remove it if type is Object.
Tried the link, but in vain Angular 2 Pipe under condition
Actual code:
What I am not able to understand is how to check String type here:
javascript - 如何更改垫扩展面板的切换图标?
切换 a 的默认图标mat-expansion-panel
是>
。设置hideToggle
true 只是隐藏切换图标。有没有办法改变它?我在官方文档中一无所获。如果状态分别是关闭或打开,我想使用+
或-
图标。
angular - 在 mat-dialog 中显示 mat-table
当我在 mat-dialog 中使用 mat-table 时,我无法显示 mat-table 内容。我可以在 DOM 中看到正确数量的“tr”,但它们是空的。
你能告诉我我做错了什么吗?
.html
.ts
css - “angular-flex-layout”没有为移动屏幕上的“mat-form-fields”添加边距
我已经使用 angular material 和 flex-layout 创建了一个响应式表单。它在桌面和 ipad 屏幕上运行良好。
对于移动设备,我想将表单域对齐到中心,并在屏幕的左右添加边距。有没有办法在 flex-layout 中做到这一点?
如果不是,如何使用自定义 CSS 来完成ngClass.xs
?我尝试将宽度设置为 90%,但它没有正确居中并且看起来很奇怪。
angular - 选择后保持 Angular Material Auto Complete 打开
我已经使用了角度材料芯片控制,这一切都很好。但是,如果自动完成元素保持打开状态以便可以进行多项选择,那就太好了。在默认状态下,您必须将焦点移至不同的控件并再次返回以重新打开自动完成功能。
我可以设置一个选项来保持自动完成打开,直到用户完全离开控件?
angular8 - 如何通过单击具有 RouterLink 仅适用于移动设备的元素来关闭 Material SideNav
我将 angular 8 与 angular 材料结合使用。我正在使用有角度的材料 Sidenav 路由器和自定义菜单:`