-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Combining attributes with expressions (e.g. ng-show conditions) in a directive with replace = true fails #10323
Comments
Yeh, here is the reproduce scenario with the latest AngularJS: http://jsfiddle.net/0usmoyjm/ I'm afraid that this might be won't fix in 1.x as I'm not even sure what should be a semantic of a merged thing. A side note: having attribute directives that got they own template isn't that common, I guess this should be an element directive. My best advice here: turn it into an element directive and remove |
attribute merging: it breaks things. Sadly, this is not likely to be fixed in 1.x. However, there is a solution to this issue in angular 2, which is putting this stuff in the "template" attribute. The API for that is awful, but we could conceivably do it in 1.x with |
@caitp: Unrelated to this issue, but I proposed this approach on a similar issue with ngMaterial (angular/material#848 (comment)). Do you have any specific issues in mind that need to be considered ? |
@gkalpak the only issue I can think of with it is where you have 3 levels of component directives, and each one uses the own-attribute and template-attribute notations, I think you'd still end up with merging in those cases |
Merging attributes when these ones have strings to be evaluated in scope can't be correct anyway. |
maybe it caused by the code
the value is always a string. so |
@angrytoro the code that you posted is to prevent other animations from overriding the |
Essentially the same as #5695 |
If both the div in the parent view does have a ng-show and the div of a directive with replace = true does have a ng-show, those conditions are bad merged.
Bug in action: http://jsfiddle.net/koningskristof/x69qwm8q/1/
The text was updated successfully, but these errors were encountered: