This is a migrated thread and some comments may be shown as answers.

Kendo and Angular - ng-if

4 Answers 735 Views
Integration with other JS libraries
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 07 Jun 2014, 04:49 PM
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.

4 Answers, 1 is accepted

Sort by
0
Mihai
Telerik team
answered on 09 Jun 2014, 08:25 AM
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!
 
0
Peter
Top achievements
Rank 1
answered on 24 Jun 2014, 07:51 PM
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 
0
Peter
Top achievements
Rank 1
answered on 24 Jun 2014, 07:53 PM
It is not even menu item any more. It doesn't react on click, hover, etc.
0
Mihai
Telerik team
answered on 25 Jun 2014, 07:28 AM
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!
 
Tags
Integration with other JS libraries
Asked by
Peter
Top achievements
Rank 1
Answers by
Mihai
Telerik team
Peter
Top achievements
Rank 1
Share this question
or