-
Notifications
You must be signed in to change notification settings - Fork 6.7k
fix(accordion): panel-open class not shown with custom class #4870
Conversation
@chenyuzhcy, so unfortunately, we can't use The issue is that the |
I don't think we used to use ng-class at all - we did manage to break ng-class support somehow in part due to replace: true being applied. For reference, here was the prior commit that added the dynamic class addition: 5ee23a4#diff-2c7728e12322ff30329ef487569c9435 |
@chenyuzhcy, here's the link to the angular issue addressing the |
@wesleycho, I couldn't remember exactly, only that we've decided to not support it. #4847 from a few days ago says as much. |
I thought our decision applied to people using ng-class on the accordion-group element? |
...and not the template used internally....yes. That's totally fair. |
@@ -1,4 +1,4 @@ | |||
<div class="panel {{panelClass || 'panel-default'}}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we do want the ng-class to replace the interpolated class, so
<div class="panel" ng-class="panelClass || 'panel-default'">
This is to keep behavior consistent with dynamic class changing.
I made the change - thanks for spending the time on this quick fix! |
will use class={{classes}} workaround instead of ng-class... |
@trickpattyFH20 you are relying on unsupported behavior in Angular itself with regards to ng-class and directives that use |
|
That would result in breaking how Bootstrap's CSS works, and all theming libraries. |
@wesleycho do you have any sources about what is considered "abuse" of ng-class? I could see it as abuse if you parsed attrs.ngClass and recompiled it in the directive... |
A simpler workaround would be to just do |
Closes #4849
Working plunker: http://plnkr.co/edit/9ZBDb8jvo0ds5lhTW5MH?p=preview