问题描述
我的工作团队最近从4.3.0升级到Angular 4.3.3.这些更改之后,mdInput和md-input-container将不再正常运行.在单击输入字段之前,动画将按material.angular.io/components/input上所示工作.
My team at work recently went to Angular 4.3.3 from 4.3.0. After these changes, mdInput and md-input-container no longer function correctly. Before you could click into the input field and the animation would work as shown on material.angular.io/components/input.
是否还有其他人遇到此问题,如果是,您采取了什么步骤解决这些问题?可能需要回到4.3.0.
Has anyone else run into this issue and if so, what steps did you take to resolve them? May need to go back to 4.3.0.
package.json -
"dependencies": {
"@angular/animations": "^4.3.3",
"@angular/cdk": "^2.0.0-beta.8",
"@angular/common": "^4.3.3",
"@angular/compiler": "^4.3.3",
"@angular/core": "^4.3.3",
"@angular/flex-layout": "^2.0.0-beta.8",
"@angular/forms": "^4.3.3",
"@angular/http": "^4.3.3",
"@angular/material": "^2.0.0-beta.8",
"@angular/platform-browser": "^4.3.3",
"@angular/platform-browser-dynamic": "^4.3.3",
"@angular/router": "^4.3.3",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"ngx-clipboard": "^8.0.4",
"rxjs": "^5.4.1",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "^1.1.3",
"@angular/compiler-cli": "^4.3.3",
"@angular/language-service": "^4.3.3",
"@types/jasmine": "2.5.45",
"@types/node": "~6.0.60",
"codelyzer": "~3.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"node-sass": "^4.5.3",
"protractor": "~5.1.2",
"ts-node": "~3.0.4",
"tslint": "~5.3.2",
"typescript": "~2.3.3"
}
推荐答案
我相信我找到了该问题的答案.在我的index.html上,我已链接到此:
I believe that I found an answer to the question. On my index.html I was linking to this:
<link href="https://rawgit.com/angular/material2-builds/master/prebuilt-themes/indigo-pink.css" rel="stylesheet">
但是,当我从index.html中删除它并将其添加到styles.scss中时:
However, when I removed that from the index.html and added this to styles.scss:
@import '~@angular/material/prebuilt-themes/indigo-pink.css';
它工作得很好,我没有像以前那样的问题.
it worked just fine and I didn't have the issues like before.
这篇关于Angular 4.3.4破坏了mdInput和md-input-container的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!