darul75 / angular-awesome-slider

:arrows_clockwise: Angular slider control directive
http://darul75.github.io/angular-awesome-slider/
MIT License
144 stars 63 forks source link

Cannot read property 'vertical' of undefined #51

Closed Joneser closed 9 years ago

Joneser commented 9 years ago

Hi, I am trying to use your control however I am getting the error shown in the title.

The code I am using looks like the following-

<input ng-model="value" type="text" id="mySlider1" slider options="sliderOptions" />
`
        $scope.sliderOptions = {
            from: 1,
            to: 100,
            step: 1,
            dimension: " km",
            vertical: false
        };
``
Joneser commented 9 years ago

I get the same error even when I don't try to define my own options:

<input ng-model="value" type="text" id="mySlider1" slider />
darul75 commented 9 years ago

I check to put default values for options soon, can you try version released 2.1.2 in the meantime https://github.com/darul75/ng-slider/releases/tag/2.1.2

Joneser commented 9 years ago

Hi darul,

Thanks for the quick reply but I still get that problem with 2.1.2

I'll wait for the update, thanks again, David

Joneser commented 9 years ago

Hi, I have it working locally now but for some reason I needed to add the options object inline as it didn't seem to pick up my options variable:


<input ng-model="value" type="text" id="mySlider1" slider options="{
                from: 1,
                to: 100,
                step: 1,
                dimension: 'km',
                vertical: false,
                css: {
                    background: {'background-color': 'silver'},
                    before: {'background-color': 'purple'},
                    default: {'background-color': 'white'},
                    after: {'background-color': 'green'},
                    pointer: {'background-color': 'red'}
                }
            }" />
darul75 commented 9 years ago

ok I am patching it right now

darul75 commented 9 years ago

no options will throw error, inline variable can be used now in 2.1.3