1
ng-clickで複数の要素のクラスを個別に切り替えるにはどうすればよいですか?Toggleクラスhide複数のangularjを表示
Iは、表示/非表示を切り替えたいが、私は1を押すと、両方の入力がショーを取得します。
.controller('AppCtrl',['$scope', function($scope){
$scope.custom = true;
$scope.ShowHide = function() {
$scope.custom = $scope.custom === false ? true: false;
};
}]);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div class="item item-checkbox">
<label class="checkbox">
<input type="checkbox" value="on" ng-click="ShowHide()">
</label>
Test1
</div>
<div class="item range range-positive" ng-hide="custom">
<input type="range" min="0" max="10" step="1" >
</div>
<div class="item item-checkbox">
<label class="checkbox">
<input type="checkbox" value="on" ng-click="ShowHide()">
</label>
Test2
</div>
<div class="item range range-positive" ng-hide="custom">
<input type="range" min="0" max="10" step="1" >
</div>
は10個のアイテムを持っているチェックボックス
ng-model
を適用するかもしれないように私は個人を与えることができます変数 – sridharan@sridharanそれで、それらをすべてレンダリングするのに 'ng-repeat'を使わないのはなぜですか?この事は、私は呼ばなく、jQueryの$(のような任意のオプションを持っている場合、私は –
になりますこれ) – sridharan