I am attempting to display the changing value on the web page every second, but for some reason {{}} is not functioning correctly. However, when I use console.log, it does show the changing value.
Here is an excerpt from my .ts code:
randomValue: number;
processIncrementValue(){
this.randomValue = Math.floor((Math.random()*100)+1);
console.log("Generating random number: " + this.randomValue);
}
// This function changes the value upon button press
start(){
console.log("Generating random number: start " + this.randomValue);
this.myVar = setInterval(this.processIncrementValue, 1000);
}
Snippet from .HTML file:
<div class="row">
<button type="button" class="btn btn-primary" (click)="start()">Start</button>
<hr>
<div class="row">
<p>My name is: {{randomValue}}</p>
</div>
</div>