2015-03-13 25 views
0

我有一個用於過濾產品的範圍滑塊。它在這個codepen中工作得很好,但是當我將它移到我的大型縮放產品上時,它不會滑動,它會在我的下面的所有<divs>上打破我的count代碼。這是產品的codepenAngularJS代碼在一個codepen中工作,但移動時會中斷

我正在使用Rzajac's range slider可以找到here

HTML

<rzslider 
     rz-slider-floor="priceSlider.floor" 
     rz-slider-ceil="priceSlider.ceil" 
     rz-slider-model="priceSlider.min" 
     rz-slider-high="priceSlider.max" 
     rz-slider-step="{{priceSlider.step}}"></rzslider> 

var app = angular.module('plunker', ['rzModule']); 

app.controller('MainCtrl', function($scope) { 

    $scope.priceSlider = { 
    min: 0, 
    max: 20, 
    ceil: 20, 
    floor: 0, 
    step: 1 
    }; 

$scope.products = [ 
     { 
      name: 'one', 
         height: '00' 
        }, 
      { 
      name: 'two', 
         height: '10' 
        }, 
      { 
      name: 'three', 
         height: '20' 
        } 
    ]; 

    $scope.minFilter = function (p) { 
     return p.height >= $scope.priceSlider.min; 
    }; 

    $scope.maxFilter = function (p) { 
     return p.height <= $scope.priceSlider.max; 
    }; 
}); 

滑塊位於 「大小」 選項卡,感謝幫助傢伙!

回答

4

您在第一個Codepen和Angular 1.0.7中使用了Angular 1.2.4。更老的Angular抱怨說它不瞭解你的指令:

​​
+0

哇,有時候我只是覺得如此'該死'愚蠢。大聲笑感謝您的幫助!我在第二個版本中使用了Angular 1.2.4,但只有觸摸版本和我一定錯過了1.0.7版本。 只要它讓我接受你的答案 – 2015-03-13 18:35:39

+0

嘿沒問題。我們有時忽略簡單的事情。樂意效勞! :) – brianvaughn 2015-03-13 18:38:35

相關問題