Kendo and Angular - ng-if

5 posts, 0 answers
  1. Peter
    Peter avatar
    7 posts
    Member since:
    May 2014

    Posted 07 Jun 2014 Link to this post

    Is it possible that kendo angular directives are not initialized if directive is surrounded with ng-if directive (initially false)?

    I have that behavior with menu and window directives. Is there some workaround.
  2. Mihai
    Admin
    Mihai avatar
    153 posts

    Posted 09 Jun 2014 Link to this post

    Hello,

    It works for me.  Here is an example that shows it for a few widgets: http://plnkr.co/edit/M0IMrCk05c7zBkSJQlVp?p=preview

    Can you replicate the issue you see in a plunker?

    Regards,
    Mihai
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. UI for ASP.NET AJAX banner
  4. Peter
    Peter avatar
    7 posts
    Member since:
    May 2014

    Posted 24 Jun 2014 in reply to Mihai Link to this post

    I can't reproduce this here but ng-if still making problems.
    Look here what happened with hidden menu item (style) after visibility has been changed http://plnkr.co/edit/xpbru4ALDW4eMHDZXQD2?p=previewI 
  5. Peter
    Peter avatar
    7 posts
    Member since:
    May 2014

    Posted 24 Jun 2014 in reply to Peter Link to this post

    It is not even menu item any more. It doesn't react on click, hover, etc.
  6. Mihai
    Admin
    Mihai avatar
    153 posts

    Posted 25 Jun 2014 Link to this post

    Hi,

    That's because with ng-if the item is not in the DOM at all when the widget is first constructed.  It's the same problem as with ng-repeat, unfortunately not fixable.

    For this case you can use ng-show instead: http://plnkr.co/edit/YEFxNMmuFnjbXS7sCA7B?p=preview

    Regards,
    Mihai
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
UI for ASP.NET AJAX banner