I want to change a status message, show success if success then return to my first message
<p>I have my message as "Ready to Scan", if the scan success I want the background color to be green, and red if not then I need it to come back to the first message "Ready To Scan", mine now it stays on Scan Success and it doesn't return back to my original message.</p>

<pre><code>    scanMsg = "Ready To Scan"
    if (data.status == "success") {
        scanMsg = "Scan Success";
    }else {
        scanMsg = "Failed";
        }
    }

    &lt;div id="divScanMsg" class="cssTitleCenter cssFontS cssCurEdges pull-right" ng-class="'bg-green':vm.scanMsg==='Scan Success', 'bg-red': scanMsg === 'Failed'" style="height: 30vh; width: 50%; overflow-y:scroll; border-style:double; border-width:25px;"&gt;{{ vm.scanMsg }}&lt;/div&gt;
</code></pre>