-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ng-include with ng-transclude - should be in core #6580
Comments
@parliament718 I would argue instead that this is primarily the CSS's fault; I've been tripped over by the very restrictive You can easily fix this issue with an |
@gsklee You do have a point, thanks for weighing in. On the other hand, I would argue that pointless wrappers just for the sake of Restrictive CSS3 selectors are the solution to such problems as nested dropdowns where |
I agree, adding DOM nodes is very obtrusive. There should be an option to replace the ng-include element. I'm using angular-ui-bootstrap in my use case. I load navigation items from a service. Some of the items have drop down menu partials, which means I need to dynamically include them, however this is not possible unless I want to make the ng-include element the menu item container and change the partials to only render the menu items. This feels wrong of course. |
Just chiming in here about breaking selectors. The |
This would make a great addition, and remove the need to create custom directives whose only purpose is to load a partial template. I'm currently working on a dynamic Reveal.js slideshow, and the slideshow framework is quite picky about its use of adjacent and nested |
This should really be included! Also have these issues in my current project. |
@gsklee |
I really think ng-transclude should work out of the box with ng-include. The wrapper markup generated by ng-include often breaks many css selectors such as "parent > directChild" and "element + directSibling". For example, a simple bootstrap dropdown:
If template.html contains the
<ul class="dropdown-menu">
, it will be wrapped in<div class="ng-scope">
and will no longer work. Ng-include should really account for this type of situation either with a replace option or transclude support:Replace option would put the extra attributes like class="ng-scope" directly on the element instead of using a wrapper:
Transclusion option :
Any reasons against this?
The text was updated successfully, but these errors were encountered: