How to use mustache notation within in a nodered ui template

My node-red UI template node starts with a script like this:

<script>
    (function($scope) {

later on in the script there is an if statement like this:

} else if ($scope.msg.topic === "temperature_avg") {
        
        high = 88;
        mid = 65;
        low = 60;
        size= "0.9em";
        }

Instead of having the variables hardcoded inside this script I want to pass them via msg.payload.ranges1 and have the if statement looking like this:

} else if ($scope.msg.topic === "temperature_avg") {
        
        {{msg.payload.ranges1}}
        }

But its not working.