Meg
Meg

Reputation: 451

How to detect if html finished rendering?

With Angular2, I want to disable a button while loading html and make it enable when finishing rendering. How can I detect when finishing rendering?

Upvotes: 1

Views: 197

Answers (1)

juan.obando
juan.obando

Reputation: 209

You can use the attribute defer in the <script> tag that loads your Angular code. This will ensure the code inside that script will be executed right after the rendering process is done. Have a look on this example

Upvotes: 2

Related Questions