How to use date picker in Angular 2?

前端 未结 9 2088
耶瑟儿~
耶瑟儿~ 2020-12-08 20:03

I have tried many date picker in my angular2 app but none of them is working.Although the date picker is displaying on the view but the value of selected date is not getting

9条回答
  •  醉话见心
    2020-12-08 20:21

    In fact, you can use a datepicker by simply adding the date value into the type attribute of your inputs:

    
    

    In some browsers like Chrome and Microsoft Edge (not in Firefox), you can click on the icon within the input to display the date picker. Icons appear only when you mouse is over the input.

    To have something cross browsers, you should consider to use Angular2 compliant libraries like:

    • https://github.com/kekeh/mydatepicker
    • https://github.com/jkuri/ng2-datepicker

提交回复
热议问题