From my nav menu I want to active and focus perticular tab how can i do it ?
Anyone pleas give me example for active tab from my nav view
Also tab is dynamic and menu item list same as tab list
Please post this on the forums.
please let me know if you know
i want to share issued in forums also.
and see this video to how exactly problem i face
https://drive.google.com/file/d/0B0qdA1kUoM_hUTdUT3NCd2ltRTg/view?usp=sharing
@bhandaribhumin Here is a quick example that shows you how to change tabs programmatically using the md-selected attribute:
http://codepen.io/topherfangio/pen/wGgmLq?editors=1010
If you still have trouble; please ask on the forums as GitHub is really only for submitting bugs :smile:
no not working when by default i set my md-selected="3" whichis also not working don't know what's the problem? i am stuck please help me
$scope.selectedIndex = 1; is not working while controller load
i just check $scope.selectedIndex = 2; but not working on controller first load
and also not working wile i call function and change $scope.selectedIndex = 3; or $scope.selectedIndex = 4;
from my nav bar
nav-menu .html
ng-click="getItems(cat_id,$index)">
category.html in category controller initialize $scope.selectedIndex = 1; $rootScope.getItems = function(cat_id,index){ } https://drive.google.com/file/d/0B0qdA1kUoM_hWUtPUTdrMUlzV2M/view?usp=sharing
console.log('cat id');
$scope. selectedIndex = index+2;
$mdSidenav('left').close();
when i click on $rootScope.getItems(), check selectedIndex value it's seems like
$scope.$watch('selectedIndex', function(current, old){
console.log('current',current);
console.log('old',old);
});
Console output
current 2
old 3
Most helpful comment
@bhandaribhumin Here is a quick example that shows you how to change tabs programmatically using the
md-selectedattribute:http://codepen.io/topherfangio/pen/wGgmLq?editors=1010
If you still have trouble; please ask on the forums as GitHub is really only for submitting bugs :smile: