katemihalikova / ion-datetime-picker

Date and/or time picker for awesome Ionic framework
MIT License
169 stars 101 forks source link

Not getting value in controller #108

Closed inceptivetech closed 7 years ago

inceptivetech commented 7 years ago

Hi,

I did the following code,

In HTML,

Date: {{clockinTime | date: "yyyy-MM-dd h:mm:ss a"}}

In .js file,

$scope.clockInTime = null;

I did not getting value in $scope.clockInTime after selecting date and time from datepicker. Also I refer your #81, but not getting solution Please help me out.

Thanks

inceptivetech commented 7 years ago

" {{clockInTime | date: "yyyy-MM-dd h:mm:ss a"}} "

This is my html code

katemihalikova commented 7 years ago

Hi, see #14. Your have some nested scopes so you need to have a dot in your models.

inceptivetech commented 7 years ago

Thanks for quick reply.

I also refer #14 as well. Follow this http://stackoverflow.com/questions/17178943/does-my-ng-model-really-need-to-have-a-dot-to-avoid-child-scope-problems this link. But still issue is same. $scope.clockInTime getting null while submitting date & time to DB.

katemihalikova commented 7 years ago

clockInTime still doesn't have a dot in it.

inceptivetech commented 7 years ago

Yesssssss......!!!!!!! Issue solve. Thank you so much....

I need one more help but not regarding this issue. Can you please help me out?

I select date and time from date picker. I add button on html for selecting current date & time. Value is update in controller but html not getting update. HTML showing me selected date & time from datepicker. not showing current date & time which is set from controller. This is my following code from .js file

$scope.selectNow = function () { $scope.clockInTime = new Date().toISOString(); }

HTML code is same as above.

katemihalikova commented 7 years ago

Same problem, clockInTime should have a dot.

inceptivetech commented 7 years ago

Yessssssss......!!!!! Fix that...!!!!

Thank you very much.... Very happy.... Facing this issue from 3 days.... Thank you so much