angular router navigate inside setTimeout
setTimeout(this.navigateToLogin.bind(this),3000);
Here is what the above code is Doing:
1. We are using the setTimeout() method to call the navigateToLogin() method after 3 seconds.
2. We are using the bind() method to bind the navigateToLogin() method to the current component.