Javascript 角度材质2工具提示问题

Javascript 角度材质2工具提示问题,javascript,html,angular,typescript,angular-material,Javascript,Html,Angular,Typescript,Angular Material,我只是向div添加了工具提示,如下所示: <div matTooltip="yeayh"> </div> 工具提示显示时没有问题,但我在浏览器控制台中看到: ERROR TypeError: Cannot read property 'matches' of null at Object.eval [as updateRenderer] (TooltipComponent.html:1) at Object.debugUpdateRenderer [a

我只是向div添加了工具提示,如下所示:

<div  matTooltip="yeayh">
</div>
工具提示显示时没有问题,但我在浏览器控制台中看到:

ERROR TypeError: Cannot read property 'matches' of null
    at Object.eval [as updateRenderer] (TooltipComponent.html:1)
    at Object.debugUpdateRenderer [as updateRenderer] (core.js:11087)
    at checkAndUpdateView (core.js:10463)
    at callViewAction (core.js:10699)
    at execComponentViewsAction (core.js:10641)
    at checkAndUpdateView (core.js:10464)
    at callViewAction (core.js:10699)
    at execEmbeddedViewsAction (core.js:10662)
    at checkAndUpdateView (core.js:10459)
    at callViewAction (core.js:10699)

尝试更改@angular/cdk版本,例如^6.0.0

尝试更改@angular/cdk版本,例如^6.0.0

尝试将angular材质更新到新版本7.2.1 见说明

然后将css添加到文件\src\styles.css中


@导入“@angular/material/prebuild themes/deeppurple amber.css”

尝试将角度材质更新到新版本7.2.1 见说明

然后将css添加到文件\src\styles.css中


@导入“@angular/material/prebuild themes/deeppurple amber.css”

似乎在加载dom之前,某些js正在运行。你能追踪错误吗?这是我从控制台得到的所有信息,问题似乎来自TooltipComponent,它是tooltip的材料组件。在这里,我不知道如何解决这个问题,或者至少从准确的角度找到问题所在。你可以使用chrome调试器来跟踪它。似乎在加载dom之前,一些js正在运行。你能追踪错误吗?这是我从控制台得到的所有信息,问题似乎来自TooltipComponent,它是tooltip的材料组件。在这里,我不知道如何解决这个问题,或者至少从准确的角度找到问题所在。你可以使用chrome调试器来跟踪它。-这里也有同样的问题。因此,当我更改“cdk”版本时,问题是goneI使用的是cdk版本:6.4.5-这里是相同的问题。因此,当我更改“cdk”版本时,问题是goneI使用的是cdk版本:6.4.5
ERROR TypeError: Cannot read property 'matches' of null
    at Object.eval [as updateRenderer] (TooltipComponent.html:1)
    at Object.debugUpdateRenderer [as updateRenderer] (core.js:11087)
    at checkAndUpdateView (core.js:10463)
    at callViewAction (core.js:10699)
    at execComponentViewsAction (core.js:10641)
    at checkAndUpdateView (core.js:10464)
    at callViewAction (core.js:10699)
    at execEmbeddedViewsAction (core.js:10662)
    at checkAndUpdateView (core.js:10459)
    at callViewAction (core.js:10699)