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

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

After import MdDatepickerModule and MdNativeDateModule, in my html:



        
相关标签:
1条回答
  • 2021-01-14 01:23

    <md-datepicker-toggle> 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 <md-datepicker-toggle> 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)
提交回复
热议问题