-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Allow multiple transcluding directives on an element #4357
Comments
This may be a duplicate of #4350. |
Issue an error and abort compilation when two directives that ask for transclusion are found on a single element. This configuration is not supported and we previously failed to issue the error because in the case of element transclusion the compilation is re-started and this caused the compilation context to be lost. The ngRepeat directive has been special-cased to bypass this warning because it knows how to handle this scenario internally. This is not an ideal solution to the problem of multiple transclusions per element, we are hoping to have this configuration supported by the compiler in the future. See angular#4357. Closes angular#3893 Closes angular#4217 Closes angular#3307
Issue an error and abort compilation when two directives that ask for transclusion are found on a single element. This configuration is not supported and we previously failed to issue the error because in the case of element transclusion the compilation is re-started and this caused the compilation context to be lost. The ngRepeat directive has been special-cased to bypass this warning because it knows how to handle this scenario internally. This is not an ideal solution to the problem of multiple transclusions per element, we are hoping to have this configuration supported by the compiler in the future. See angular#4357. Closes angular#3893 Closes angular#4217 Closes angular#3307
Issue an error and abort compilation when two directives that ask for transclusion are found on a single element. This configuration is not supported and we previously failed to issue the error because in the case of element transclusion the compilation is re-started and this caused the compilation context to be lost. The ngRepeat directive has been special-cased to bypass this warning because it knows how to handle this scenario internally. This is not an ideal solution to the problem of multiple transclusions per element, we are hoping to have this configuration supported by the compiler in the future. See #4357. Closes #3893 Closes #4217 Closes #3307
+1 |
4 similar comments
+1 |
+1 |
+1 |
👍 |
A great idea. Very much like the Marionette region concept, or ui-router's idea of sibling views, but constrained to a single directive. #4350 gives the example of a modal or something with a body and a title. You could also use this for window/side pane and other ui structures that have multiple content panes. |
Looks like you can transclude into multiple locations "manually": https://web.archive.org/web/20130721070741/http://blog.omkarpatil.com/2012/11/transclude-in-angularjs.html |
Issue an error and abort compilation when two directives that ask for transclusion are found on a single element. This configuration is not supported and we previously failed to issue the error because in the case of element transclusion the compilation is re-started and this caused the compilation context to be lost. The ngRepeat directive has been special-cased to bypass this warning because it knows how to handle this scenario internally. This is not an ideal solution to the problem of multiple transclusions per element, we are hoping to have this configuration supported by the compiler in the future. See angular#4357. Closes angular#3893 Closes angular#4217 Closes angular#3307
Issue an error and abort compilation when two directives that ask for transclusion are found on a single element. This configuration is not supported and we previously failed to issue the error because in the case of element transclusion the compilation is re-started and this caused the compilation context to be lost. The ngRepeat directive has been special-cased to bypass this warning because it knows how to handle this scenario internally. This is not an ideal solution to the problem of multiple transclusions per element, we are hoping to have this configuration supported by the compiler in the future. See angular#4357. Closes angular#3893 Closes angular#4217 Closes angular#3307
Great idea. Just came across a use case for this, wanting to transclude with an attribute directive after ng-include on the same element. Was hoping it would just priority-order the transcludes. |
+1 |
+1 This is IMHO one of the best parts of the Web Components / Shadow DOM spec |
+1 |
+1 Needed for doing complex + awesome stuff. :-) |
+1 |
1 similar comment
+1 |
+1 I have an element directive with |
@Maxmaxmaximus what? |
@Maxmaxmaximus it is a fantastic idea, it's just not been implemented yet. See also #7270 |
+1 |
Got workaround for this when used in custom directive. <div cs-composite>
<div cs-section="header">
Composite Component Header
</div>
<div cs-section="footer">
Composite Component Footer
</div>
</div> |
+1 |
One implementation of multi-transclude: https://github.com/zachsnow/ng-multi-transclude |
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1 all day long |
+1 |
3 similar comments
+1 |
+1 |
+1 |
👍 Is this still on the roadmap? |
+1 |
+1 |
1 similar comment
+1 |
👍 |
+1 |
2 similar comments
+1 |
+1 |
This is being worked on in #12934 |
+1 |
2 similar comments
+1 |
+1 |
This feature is now in Angular 1.5. |
Thanks @petebacondarwin 👍 |
There's a scenario which requires to allow multiple directives on same element that uses transclusion.
|
@ahmadhsalim - please create a new issue if you have a problem. It is best not to try to add on to close issues. |
I believe it's possible, so let's try it.
The text was updated successfully, but these errors were encountered: