Nisha Patel
Problems
I'm not sure how to access "this" from a function in Angular.
This is my HTML
I'm basically trying to change the frames every X seconds to make one of the characters blink. This is my component so far:
Help is much appreciated!
Solutions
It's basically the approach you have described, you just need to put it into your code. Below is one way you can do it.
After every 2 seconds it will change to 0 and stay 0 for 2 seconds then change to a random number between 1-5 and stay that for 2 seconds.
Here is a >Stackblitz Demo where you can play with this code and see this in action
Suggested blogs:
>Why Typescript does not allow a union type in an array?
>Narrow SomeType vs SomeType[]
>Create a function that convert a dynamic Json to a formula in Typescript
>How to destroy a custom object within the use Effect hook in TypeScript?
>How to type the values of an object into a spreadsheet in TypeScript?
>Type key of record in a self-referential manner in TypeScript?
>How to get the last cell with data for a given column in TypeScript?
>Ignore requests by interceptors based on request content in TypeScript?
>Create data with Typescript Sequelize model without passing in an id?
>How to delete duplicate names from Array in Typescript?