cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Reset model properties with a button that is binded to sliders

jaragon
1-Visitor

Reset model properties with a button that is binded to sliders

I have this on my Home.js and a button with the script resetButton(); It works fine, but only one time after that the button has no effect.

$scope.changeColor1 = function()

{

  $scope.app.params.Color = 'rgba(255,255,255,1);';

};

$scope.changeColor2 = function()

{

  $scope.app.params.Color = 'rgba(17,193,243,1);';

};

$scope.changeColor3 = function()

{

  $scope.app.params.Color = 'rgba(51,205,95,1);';

};

$scope.changeColor4 = function()

{

  $scope.app.params.Color = 'rgba(255,201,0,1);';

};

$scope.changeColor5 = function()

{

  $scope.app.params.Color = 'rgba(0,0,0,1);';

};

$scope.resetButton = function()

{

  $scope.app.params.Scale = 1.0;

  $scope.app.params.SliderX = 0;

  $scope.app.params.SliderZ = 0;

};

2 REPLIES 2
gnandyala
14-Alexandrite
(To:jaragon)

Hi Jose;

With the piece of code you gave i don't see any fault. Let me know the application scenario and how you are implementing it in thingworx.

the app has a model and 3 sliders that control the scale, x-axis rotation and z-axis rotation. I also created 3 application parameters (Scale, SliderX,SliderZ) each of them binded to their respective slider. at the same time each slider is binded to their respective model item property.

Thanks.

Announcements


Top Tags