Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/377.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 角度-下一个选项卡按钮_Javascript_Angularjs_Tabs - Fatal编程技术网

Javascript 角度-下一个选项卡按钮

Javascript 角度-下一个选项卡按钮,javascript,angularjs,tabs,Javascript,Angularjs,Tabs,将此用作构建我的选项卡的基础 目前正在尝试实现“继续”和“返回”选项卡按钮,而不是直接单击您希望访问的按钮 我想知道是否有可能实现 $scope.nextButton = function(tab) { $scope.currentTab = $scope.tabs[tab].next.url } 我希望放置下一个按钮的位置将不在 ng-repeat='tab in tabs' 不确定如何通过当前选项卡 我们将一如既往地感谢您的帮助。您可以在下面的小提琴中找到一个例子: 你可以继

将此用作构建我的选项卡的基础

目前正在尝试实现“继续”和“返回”选项卡按钮,而不是直接单击您希望访问的按钮

我想知道是否有可能实现

$scope.nextButton = function(tab) {
    $scope.currentTab = $scope.tabs[tab].next.url
}
我希望放置下一个按钮的位置将不在

ng-repeat='tab in tabs'
不确定如何通过当前选项卡


我们将一如既往地感谢您的帮助。

您可以在下面的小提琴中找到一个例子:

你可以继续改进,但你明白了

$scope.history = {};
$scope.history.tabs = [];
$scope.history.tabs.push($scope.currentTab);
$scope.history.index = 0;
$scope.history.maxIndex = 0;

$scope.previous = function() {
    if ($scope.history.index <= 0)
        return;
    $scope.history.index--;
    $scope.currentTab = $scope.history.tabs[$scope.history.index];
};
$scope.next = function() {      
    if ($scope.history.index === $scope.history.maxIndex)
       return;
    $scope.history.index++;
    $scope.currentTab = $scope.history.tabs[$scope.history.index];
};
$scope.history={};
$scope.history.tabs=[];
$scope.history.tabs.push($scope.currentTab);
$scope.history.index=0;
$scope.history.maxIndex=0;
$scope.previous=函数(){
如果($scope.history.index
$scope.history = {};
$scope.history.tabs = [];
$scope.history.tabs.push($scope.currentTab);
$scope.history.index = 0;
$scope.history.maxIndex = 0;

$scope.previous = function() {
    if ($scope.history.index <= 0)
        return;
    $scope.history.index--;
    $scope.currentTab = $scope.history.tabs[$scope.history.index];
};
$scope.next = function() {      
    if ($scope.history.index === $scope.history.maxIndex)
       return;
    $scope.history.index++;
    $scope.currentTab = $scope.history.tabs[$scope.history.index];
};