材质2.0.0-beta.3 md滑块不拖动 [英] Material 2.0.0-beta.3 md-slider not dragging
问题描述
希望这是一个愚蠢的问题.
Hopefully, this is a stupid question.
我刚刚在为雇主创建的项目中添加了md滑块. (因此我没有代码表示抱歉)
I just added a md-slider to a project I am building for my employer. (thus I have no code to show sorry)
我将MdSliderModule导入到我正在使用的模块中.在我想要的模板中添加了标签.它出现了,看起来不错,但不会拖动.我可以单击它来更改其值,但不能拖动它.
I Imported MdSliderModule into the module I'm working in. Added the tag in my template where I wanted it. It showed up and looks great but won't drag. I can click on it to change its value but I can't drag it.
我错过了什么吗? Angular是否有我需要导入的该组件使用的拖动模块?其他人看到了吗?
Am I missing something? Does Angular have a Dragging module this component uses that I need to import? Has anyone else seen this?
我们正在使用:
- 角^ 4.0.2
- 材料2.0.0-beta.3
我想尝试的任何帮助或建议都将有所帮助.预先感谢您的宝贵时间.
Any help or suggestions of things for me to try will be helpful. Thank you in advance for your time.
推荐答案
在发现我没有安装Hammer.js之前,我遇到了完全相同的问题.
I had exactly the same problem until I discovered that I hadn't installed hammer.js.
npm install --save hammerjs
然后在您的angular-cli.json
文件的scripts
数组中添加Hammerjs作为依赖项:
then add hammerjs as a dependency in the scripts
array of your angular-cli.json
file:
"scripts": [
//possibly other scripts here...
"../node_modules/hammerjs/hammer.min.js"
],
...
希望这可以解决问题-重新编译所有内容以确保更改生效
Hopefully this will resolve the issue - recompile everything to be sure that changes take effect
这篇关于材质2.0.0-beta.3 md滑块不拖动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!