Clicked Button with Random Function

I want the image to be rotated in random degree every time user clicked on the image. I used this code but the value of degree didn’t change when I clicked on the image it taked the same value of the first one, I mean when I clicked the image it gave me the same degree every time but it is only changed and gave me another random number when opened the page again.

You degree is not being updating as the value is being returned once.

You could do something like (I am sure there is a bettter way):

var degree = Observable();
function changeDegree() {
    degree.value = Math.floor(Math.random() * (360 - 20 + 1)) + 20;
module.exports = {
    degree: degree,
    changeDegree: changeDegree

    <Callback Handler="{changeDegree}" />
    <DebugAction Message="{degree}" />
    <Rotate Degrees="{degree}" Duration="1"  />

Thank you for your response.