Angularjs date-time-picker binding issue

2 posts, 0 answers
  1. OMER
    OMER avatar
    32 posts
    Member since:
    Dec 2013

    Posted 11 Dec 2014 Link to this post

    I have 2 issues with this widget:
    1) - when I set the date from the controller, the "str" is empty (e.g. no ng-model). If you comment out the $scope.obj = new Date();, it works fine...
    2) This might be related. When my SPA initiates, I inhabit the model in a directive. This reflects in the widget only after I reload the view (e.g. by routing to another view and coming back, using angularjs core routing).
    I'm using angularjs 1.2.27 and the latest kendoui (Q3 2014).
  2. Georgi Krustev
    Georgi Krustev avatar
    3687 posts

    Posted 15 Dec 2014 Link to this post

    Hello OMER,

    The widget will not update all of its bindings when one is change from the scope. That being said, you will need to keep your scope synced if some of the fields are updated manually:
    $scope.obj = new Date();
    $scope.str = kendo.toString($scope.obj, "MM/dd/yyyy hh:mm tt");
    Here is the updated demo.

    With regards to the second question, I am afraid that I cannot quite understand what is the erroneous behavior and what is causing it. Could you provide a Dojo demo that we can review?

    Let me know if I am missing something.

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top