@jkandasa Thanks for confirming that in 1.5, the hardcoding of rzModule in mycontroller/www/app.js isn't required. However if I remove rzModule then the slider widget isn't displayed.
Still I can't get the example to work...I've got the id from the place you mention, mine is still 31... I've also noticed that the intial value of the sensor->variable isn't populated. I created simple script to update the value
var myImports = new JavaImporter(java.lang, java.util, org.mycontroller.standalone.utils.McUtils);
with(myImports) {
dimSensor = mcApi.uidTag().getByUid("dimSensor").getResource();
var v = dimSensor.value; //value2/3 etc
dimSensor.setValue(parseInt(v) + 1);
mcApi.sensor().sendPayload(dimSensor);
}
I insert the following code into "AngularJs custom controllers"
myControllerModule.controller('myCustomWidgetController', function($scope, SensorsFactory){
$scope.sVariable = {
id: null,
value:null
};
$scope.loadVariable = function(){
SensorsFactory.getVariable({id:$scope.sVariable.id}, function(response){
if(response.value != undefined){
$scope.sVariable.value = parseInt(response.value);
}
});
}
$scope.slider = {
options: {
floor: 0,
ceil: 100,
step: 1,
minLimit: 0,
maxLimit: 90,
onEnd: function() {
$scope.sendPayload($scope.sVariable);
},
}
};
// send payload
$scope.sendPayload = function(sVariable){
SensorsFactory.updateVariable(sVariable, function(){
//update Success
},function(error){
displayRestError.display(error);
});
};
});
Which is just the original example above, no changes... it seems to me that the pointer/reference to the variable I want to have connected to the slider is correct or working, both when the value is initialized on the loadVariable and when updated. But I just can't see what I've done wrong.