-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Conditional tabs #319
Comments
You could: a. put it in an ng-repeat
|
I've seen the ng-repeat style for tabs, but that style seems to favor embedding view information in javascript files or lots of partials, neither of which really fits my use case. I just ran a plunker using ui-if and it does seem to work as expected, though ng-show fails pretty miserably. Guess I'll head down the ui-if route next time. |
what is suggested now, ui-if says removed in the documentation. Need a way to hide or not render the tabs. |
oh thanks, thought it was in the angular-ui code base. On Thu, Oct 3, 2013 at 12:13 PM, Andy Joslin notifications@github.comwrote:
|
I had a similar desire and ng-if wasn't working for me. Specifically, it complained that two templates wanted to transclude something. This an obvious dumb thing I did, or a new restriction? Regardless, for a local build, I went ahead and added an attribute to [1] I changed it so that it simply doesn't put the tab or its contents on the page if it is not visible. |
angular-ui#319 fix for lock selections
I've read a couple of the issues around tabs, namely:
#195
#287
Neither seems to address the use case of conditional inclusion. Although I am an Angular novice, from the examples I have seen, there seems to be no obvious way to conditionally render a pane/tab (the latter being the name from #287). The effect I want to achieve would look like this:
Because pane/tab are custom directives and don't support ng-show, I cannot simply avoid including a particular tab based on a conditional. This effect was easy to achieve by rolling my own tab solution, but it seems like the use case may be common enough, given the existence of ng-show/ui-show in the first place, to warrant support in the directive itself. The directive could also support ng-include as an attribute, with the include only occurring if the specified condition is met.
I did try wrapping the directives in show/hide directives, but because of the way they are rendered, this has no effect.
The text was updated successfully, but these errors were encountered: