bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Setting the active tab fails if an inline expression is set in the active attribute

Open munsellj opened this issue 12 years ago • 4 comments

Inline expressions should be allowed to set the active tab.

Example: http://plnkr.co/8099ELlVC7f9ck63gYaV

munsellj avatar Jan 19 '14 18:01 munsellj

This is because it tries to process what you put into the active attribute and it expects it to be boolean, but in your case there is no boolean so it fails. What is it you exactly what you're trying to accomplish through this kind of expression?

mvhecke avatar Jan 19 '14 19:01 mvhecke

After searching a bit, it seems this is a duplicate of #1539.

mvhecke avatar Jan 19 '14 23:01 mvhecke

Yeah that looks like the same issue and the PR mentioned there should fix this in my case as well. I also submitted a PR as well (https://github.com/angular-ui/bootstrap/pull/1618).

The use case were I encountered this was comparing the route name stored as a scope variable (using Angular UI Router) to a string for each tab to set the active tab based on the current route(each tab has an associated route). I worked around the issue by using scope variables instead of an inline expression but I think either should be acceptable.

munsellj avatar Jan 20 '14 00:01 munsellj

Continuing in #1496

rvanbaalen avatar Apr 10 '15 16:04 rvanbaalen