timepicker: allow two-way binding to something else

Users of timepicker (and, later, datepicker) will amost certainly want to bind the component to a string, a moment, a Date, or some other class that provides more functionality than a simple object with three fields.

I don’t know if the component should provide this functionality (for example by passing a TimeFormat input which would be responsible for transforming the {hour, minute, second} object to something else and vice-versa), or if this should be done outside of the component. If the latter, a demo demonstrating how to do that would be helpful.

There might be two different needs BTW: creating a new string every time the model changes, and mutating the time part of a moment/Date.

1 possible answer(s) on “timepicker: allow two-way binding to something else

  1. But I’m on master, which uses the new forms module (imports are from ‘@angular/forms’), whereas your plunkr uses the deprecated forms (imports are from ‘@angular/common’). I suspect this is where the problem comes from.

    This is very probable! Let’s wait for RC5 with the new forms to land and then re-test.