Selected value is not clearing with ng-if.

2 posts, 1 answers
  1. developer
    developer avatar
    58 posts
    Member since:
    Nov 2015

    Posted 27 Jul Link to this post

    I'm having a functionality to load the DOM elements on demand. for that, I'm using ng-if the selected value is not clearing. Find the below example to reproduce the scenario.

    Dojo

    In this example, first control is with with "ng-if" and 2nd example with "ng-show". "ng-show" is working. But "ng-if" is not working. 

    Please assist to fix the issue.

  2. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 29 Jul Link to this post

    Hello,

    It seems that the specifics of ngIf directive, the first datepicker binds to a different $scope.dateFromObject instance, which prevents any subsequent model field modifications. The possible solutions in this case are:
    • use only ngShow directive, as it will keep the HTML rendered on the page
    • use "Ctrl as vm" to overcome the ngIf behavior - http://dojo.telerik.com/iqUvE

    Regards,
    Georgi Krustev
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
Back to Top