-
Notifications
You must be signed in to change notification settings - Fork 6.7k
fix(datepicker): works without ng-model #1913
Conversation
This one got rebased @bekos :) |
Continuing the discussion from #2157 I am not sure how much effort will need to maintain in the future a working datepicker without the |
@bekos that was a change you introduced after the big refactor. Earlier it was required (or it would throw an error) but it was changed to allow non usage of ng-model. I would say that now that we have the option to use it without ng-model, we could just merge this and move on. The alternative is to check again for the existence of the ng-model or throw an error. |
@Foxandxss Optional
And if 1. is easily solved if we just |
@Foxandxss I think I'm with @bekos here. If there is a future that we can see it is not used (as it is broken so people can't use it, if I'm not mistaken) let's remove it. If it is needed we can easily add it back. |
@pkozlowski-opensource at the end of the day @bekos is the maintainer of datepicker. He introduced the ability to have optional ng-model, I just fixed it because was broken. He can revert those changes and we are good to go :) |
I'm not sure we should support optional ng-model on datepickers. This looks harmless enough, but I can't forsee a situation where someone would want a datepicker but have no model attached to it. Even so, we could just require ng-model be used, even if for dummy purposes. I feel like a better change would just be to enforce ng-model's presence. |
I agree with @wesleycho . We should probably require ngModel instead. I also don't think this is a priority for 0.13, so moving this to Backlog. |
merge conflicts as well. |
This one won't be merged, i leave it open as a reminder |
This was one of the things we needed to fix on datepicker for the next version. It just needed a guard to check that there is a ngModel present.
For the tests, well, that is a hard part. There is no difference visually on the datepicker without ng-model, the only difference now is that it doesn't throw an exception :P. So I decided to test that the actual month is showed.
Testing for actual date is pretty hard because you can't hardcode anything so I decided to check that the title is the correct one.
I had to improvise a little bit on the year one :P
Ping @bekos