Promact / md2

Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Collapse, Colorpicker, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.
http://code.promactinfo.com/md2/
MIT License
379 stars 112 forks source link

Setting type property on datepicker from html doesn't work #237

Closed alexmba94 closed 7 years ago

alexmba94 commented 7 years ago

The best way to control how I want datepicker to be displayed is to set those parameters from the html itself, but for some reason the type property doesn't work this way.

On your tutorial you do: <md2-datepicker (...) [type]="date" (...)> I tried setting it to 'datetime' and 'time' but it still shows the datepicker as 'date'.

Obviously if I change the value of _type in datepicker.js it works, but changing the library is not something to be done and I want some datepickers to be 'date' and others to be 'datetime'. So if I do that, I still don't get the result I want.

I also tried to import datepicker to my angular component and set the variables from there, but that results in a ZoneAwareError.

The same goes for 'okLabel', 'cancelLabel' and 'container'. None of these properties can be set on html.

alexmba94 commented 7 years ago

Turns out that doing type="datetime" instead of [type]="datetime" as the tutorial suggests, does the trick.