katemihalikova / ion-datetime-picker

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

how to get value in a controller ? #14

Closed 13122310958 closed 8 years ago

13122310958 commented 8 years ago

Hi ,

I can't get the value in a controller while using $scope.datetimeValue . Can you tell me how to do ?

<label class="item item-icon-right" ion-datetime-picker ng-model="datetimeValue">
                        <i class="icon ion-ios-grid-view-outline positive"></i>
                        Departure Date/Time
                        <strong>{{datetimeValue| date: "yyyy-MM-dd H:mm"}}</strong>
                     </label>

Thank you very much !

katemihalikova commented 8 years ago

Hi, it seems like you are using nested scopes in your app. This question on StackOverflow can help you. Another solution would be to use controllerAs feature.

13122310958 commented 8 years ago

Yes , that's right , I have solved this problem ! Thank you !!