AngularJS ng-show / ng-hide滑块

时间:2017-05-03 09:42:10

标签: javascript angularjs combobox

我正在写小问题。

我有两个滑块:sliderL和sliderC: enter image description here

滑块有指令ng-show =" showSliderL"或ng-show =" showSliderC"。

功能:

enter image description here

它返回true或false(可能在这里我有问题)。

我有值组合框:" rl"和" rc"。 如何影响组合框的值以影响滑块的外观和隐藏?

这是我的组合框选择功能代码:

enter image description here

现在两个滑块都被隐藏了。

代码:

var myApp = angular.module('myapp', ['rzModule']);

myApp.controller('TestController', TestController);

$scope.obwody = ['RL', 'RC'];
$scope.wybranyObwod = $scope.obwody[0];

 $scope.wybierzFunkcje = function () {
        var wybor = $scope.wybranyObwod;
        if (angular.equals('RL', wybor)) {
            $scope.sliderL.isHidden = false;
            $scope.sliderC.isHidden = true;
        } else if (angular.equals('RC', wybor)) {
            $scope.sliderC.isHidden = false;
            $scope.sliderL.isHidden = true;
        } else {
            console.log('idot');
        }
    }
    $scope.wybierzFunkcje();

http://jsfiddle.net/3jjye1cL/341/

0 个答案:

没有答案