Reputation: 1136
I am using jquery CircularSlider Plugin. I am having 4 such sliders in one page. I have added custom values to the slider. Now I want to get value of each slider using angularjs Directive.
var intensity = $('#intensity').CircularSlider({
shape: "Half Circle",
min : 0,
max: 2,
value:0,
radius: 50,
touch:true,
setValue:function(value){
console.log('inside set');
value=value*10;
return value;
},
formLabel : function(value, prefix, suffix){
switch(value){
case 0:
return 'low';
case 1:
return 'med';
case 2:
return 'high';
}
}
});
This slider shows low, high, medium values. I have written directive to get its value
.directive('exampleDirective2', function() {
return {
restrict: 'E',
link: function(scope, elm, attrs) {
console.log("angular way"+angular.element(elm[0]).text());
console.log(elm[0]);
console.log(attrs);
}
};
})
<example-directive2>
<div class="intSlider" id="idInt1"> </div> </example-directive2>
But I have such 4 different sliders and want to wrap them in same directive and get its value depending upon id. Is it possible using same directive? How can i get values for each id ?
Regards, Shraddha
Upvotes: 0
Views: 263
Reputation: 959
try this once...
var yourElement = angular.element( document.querySelector( '#id' ) );
Upvotes: 1