我正在使用 Angular 9和添加的 Angular Material ,但是当我要使用垫选择时,我无法选择该选项并得到以下错误。
core.js:6241 ERROR TypeError: Cannot read property 'pipe' of undefined
at MatSelect.ngAfterContentInit (select.js:609)
at callHook (core.js:4726)
at callHooks (core.js:4690)
at executeInitAndCheckHooks (core.js:4630)
at refreshView (core.js:12054)
at refreshComponent (core.js:13458)
at refreshChildComponents (core.js:11729)
at refreshView (core.js:12064)
at refreshEmbeddedViews (core.js:13404)
at refreshView (core.js:12035)
最佳答案
转到您的package.json
文件,并确保您的版本已按照其站点上的定义进行了明确定义,并且可能与您的 Angular 版本相距不远。我正在使用 Angular 版本10.2.7,而我的 Material 版本是8.0.0。我已经在他们的网站上升级到9.2.4,并且现在可以正常工作。
关于 Angular 9 : Cannot read property 'pipe' of undefined at MatSelect. ngAfterContentInit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63698916/