Typescript, update table timer (angular app)

Daniel 156 Reputation points
2021-07-26T19:36:38.193+00:00

Hi,

Am I not supposed to use the setTimer in Typescript? It’s not in their docs.

I have a table and I want to highlight a row according to if the time is the current time.

This I solve with a ngIf to compare a string.

Now I want to update my date-time variable every minute. How would I do this in TypeScript?

Community Center Not monitored
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2021-07-27T19:47:20.567+00:00

    typescript generates JavaScript and the JavaScript language does not have timers. These are implemented by the hosting environments.

    You can use the browsers setTimeout() or setInterval() methods. The node hosting api also supports timers

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.