This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
md-tabs: allow function to be used as selectedIndex #1044
Comments
@jasonayre - As you have discovered, Tabs uses a two-way databinding to the the $scope.$watch('selectedIndex', function(current, old) {
switch(current) {
case 0: $location.url("/view1"); break;
case 1: $location.url("/view2"); break;
case 2: $location.url("/view3"); break;
}
});
|
robertmesserle
added a commit
that referenced
this issue
Jan 8, 2015
Closes #1044. By default, now tab content will animate in from whichever direction the ink-bar is moving. These animations can be overridden through the following classes: When a tab is selected, the following classes are added in order: 1. `md-transition-rtl`: flags the animation as right-to-left 2. `ng-animate`: added at the start of all animations 3. `ng-hide-remove` 4. `ng-hide-remove-active` When a tab is deselected, the following classes are added in order: 1. `md-transition-rtl`: flags the animation as right-to-left 2. `ng-animate`: added at the start of all animations 3. `ng-hide-add` 4. `ng-hide-add-active` Closes #717. Closes #811. refactor(tabs): removes unnecessary check
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Right now if I want to use a function for selectedIndex, it throws the following error
Use case (sorry using ng-classy controller if it looks weird I can translate:
Its actually working for me currently, but its still trying to assign selectedIndex which is obviously in my case a function, so throwing the error. It looks as if the directive overall was not built to support this, yet I could have sworn I had it working flawlessly in (much) earlier versions. -- Anyways it would be nice to have an interface that would allow for the above, whether assigning directly to selectedIndex or a new selectedTab argument, which is expected to be a function which returns the selected tab index. Particularly helpful for use w UI router
The text was updated successfully, but these errors were encountered: