[X] Bug
I am update withnpm install --save angular/material2-builds angular/cdk-builds
and my DatePicker not work, my browser terminal return error with mdDatepickerToggle
Can't bind to 'mdDatepickerToggle' since it isn't a known property of 'button'
<button mdSuffix [ERROR ->][mdDatepickerToggle]="pickerInit"></button>
This is my code
<md-input-container>
<input
mdInput
[mdDatepicker]="pickerInit"
placeholder="Fecha inicial"
[min]="minDate"
[max]="maxDate"
[value]="10-2-2017"
name="init"
#init="ngModel"
ngModel
required>
<button mdSuffix [mdDatepickerToggle]="pickerInit"></button>
</md-input-container>
<md-datepicker #pickerInit></md-datepicker>
5 minutes ago I worked well, I do not know what happened
Angular 4.0.0
Material github:angular/material2-builds (this show in package.json)
OS Mac
As of #5317, [mdDatepickerToggle]
attribute has been changed to md-datepicker-toggle
element
use can use md-datepicker-toggle like this:
<md-datepicker-toggle mdSuffix [for]="picker"></md-datepicker-toggle>
Hope this will help you :)
@CaerusKaru I think there is a lot of example code out there with the former type <button mdSuffix [mdDatepickerToggle]="pickerInit"></button>
https://material.angular.io/components/datepicker/overview being one.
@BenRacicot Yes, because the current release (2.0.0-beta.8) still officially supports the old type. This is a breaking change before beta 9, and the documentation will be updated accordingly.
@Thank you for clarifying @caeruskaru! Much clearer now.
Looks like beta.9 just dropped.
<md-datepicker-toggle mdSuffix [for]="picker"></md-datepicker-toggle>
is not picking up... Waiting on docs to catch up.
Guys any update regarding the usage of date-picker, on using
ERROR TypeError: Cannot read property 'disabled' of undefined
at MdDatepickerToggle.get [as disabled] (material.es5.js:20168)
at Object.View_MdDatepickerToggle_0._co [as updateDirectives] (MdDatepickerToggle.html:1)
at Object.debugUpdateDirectives [as updateDirectives] (core.es5.js:13075)
at checkAndUpdateView (core.es5.js:12255)
at callViewAction (core.es5.js:12620)
at execComponentViewsAction (core.es5.js:12552)
at checkAndUpdateView (core.es5.js:12261)
at callViewAction (core.es5.js:12620)
at execEmbeddedViewsAction (core.es5.js:12578)
at checkAndUpdateView (core.es5.js:12256)
@ronit123321 Using the example here, adding the disabled
property to md-datepicker-toggle
works properly. If you're having this issue and can recreate it in a plunkr, please file a separate issue.
Returning to an Angular + Material project after a month 馃槀 馃敨
I know your pain @elwinarens ! Look out for this too: https://github.com/angular/material2/pull/7346
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
use can use md-datepicker-toggle like this:
<md-datepicker-toggle mdSuffix [for]="picker"></md-datepicker-toggle>
Hope this will help you :)