Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upUse `ng-if` to hide inactive tabs #3109
Conversation
|
If this is merged, there needs to be a way to opt out. We sometimes use tabs for forms, and form validation wouldn't be performed on the hidden tabs if this was merged as is. |
|
Build fails and needs tests |
|
This needs to be opt-in, not opt-out, as this is a breaking change. Documentation would also need to be updated about this. |
|
I added two commits via the github interface that demonstrate an example of how to make it opt-in by providing a Just to be clear I've already solved this problem in my use case by overriding the |
|
The only thing missing here is documentation. |
|
I am going to close this due to there being adequate workarounds for using ng-if, but keep an eye out for #4836 - we are going to break the current API and fix it. |
Dawil commentedDec 16, 2014
Hi there. By using
ng-ifthe scope for the tab is destroyed when hidden. If there are a lot of large tabs then this can significantly reduce the length of a $digest cycle. Feel free to close the PR I just thought I'd mention this since I found it gave large performance improvements for my app.It's also easy for people to add this to their app without forking or modifying the code by simply placing the following code above their application code:
Note that in some cases this could change the behavior of your code and it's not surprising some of the tests failed. If you did want to in some way merge this change you'd probably rather have it as a configurable option or advise in the docs the ability to override the templateCache.