In my Typescript (.ts) file, this is the code I have:
private today: Date = new Date();
And this is the corresponding HTML:
<span [innerText]="today | date:dateFormat"></span>
Everything displays perfectly, showing 22nd May.
Now, I've added a button to subtract a day from the date:
previousDay() {
Utils.addDays(this.today, -1);
console.log(this.today);
}
When I click on the button, the console correctly logs 21st May. However, the view in the UI remains at 22nd May.
Here is the link to the Plunker I created for reference: https://plnkr.co/edit/6hw1JW0h5zNvF0owcU9U?p=preview
What could be causing this issue?