components icon indicating copy to clipboard operation
components copied to clipboard

date input when binding to getter and setter property

Open niwrA opened this issue 9 years ago • 5 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When modelbinding is initialised with a property that is a typescript getter/setter binding to an internal state object, it should take and display the initial value. <md-input (blur)="changeStartDate()" type='date' [(ngModel)]='project.startDate' placeholder="StartDate"></md-input>

What is the current behavior?

the initial value is not set on the control. Updating to the property works fine, but initialising a value from it fails. When doing this with a plain Object / non-setter/getter typed object there is no issue. EDIT: hmm, there seems to be more going on, as this no longer seems to work now either.

What are the steps to reproduce?

Couldn't get plunker to work.

What is the use-case or motivation for changing an existing behavior?

Bug

Which versions of Angular, Material, OS, browsers are affected?

material 2.0.0.0.beta.1 angular 2.3.1 Chrome latest on Windows 10

Is there anything else we should know?

The same kind of name property binding to a text input works fine. And it worked with dates before I added the wrapping object

niwrA avatar Jan 27 '17 16:01 niwrA

I can't figure this out. I don't know if it is angular material or ng-material2 or even the CLI - it changed after I updated angular to 2.3.1 while updating the angular cli. If anyone has any ideas, would be more than welcome!

niwrA avatar Jan 30 '17 17:01 niwrA

Is project.startDate a Date or a string? I guess the ngModel should be a string ('YYYY-MM-DD').

jagrodal avatar Jan 31 '17 14:01 jagrodal

@niwrA Can you try again with plunker? There isn't much information for us to use to repro.

kara avatar Feb 01 '17 00:02 kara

Closing this issue as it does not follow the issue template. Please file a new issue that follows the template, which gives the team the information needed to investigate.

mmalerba avatar Feb 01 '17 00:02 mmalerba

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.