Meterial 2 md-datepicker-toggle is not a known element

后端 未结 1 572
情话喂你
情话喂你 2021-01-14 00:50

After import MdDatepickerModule and MdNativeDateModule, in my html:



        
1条回答
  •  北荒
    北荒 (楼主)
    2021-01-14 01:23

    was introduced in Material 2.0.0-beta.10. See this CHANGELOG for more details.

    mdDatepickerToggle is now an element < md-datepicker-toggle > with a for property that points to the MdDatepicker instance.

    If you are using an earlier version of Material 2, then using will throw this error. To update to the new version, do the following:

    • In your package.json, change "@angular/material" and "@angular/cdk" version to "2.0.0-beta.10"
    • In your terminal window, navigate to the folder in your project where package.json is located.
    • Run the command npm install

    Here is a working demo using version 2.0.0-beta.10.

    0 讨论(0)
提交回复
热议问题