-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setTimeout intercepted and requires Timer type variable to be assigned to #901
Comments
Here's the first result when Googling the error you have, i.e.: ...
this.currentTimeout = window.setTimeout(() => {
alert('working');
}, 300);
... solves your problem. |
Okay, but all examples on the internet don't need it to be specified. Is it only angular2-seed issue due to some typings override(priority)? |
I think it is due to a core node.d.ts lib in typescript. |
@mgechev isn't adding window.XXXXXX breaks the possibility of running the app in server/worker based rendering scenario? I thought removing the node.js type definitions would help but unfortunately it doesn't seem to work, any other ideas? |
@nadavsinai yes, you're correct. Directly accessing |
For more info, see mgechev/angular-seed#901
IMPORTANT: This repository's issues are reserved for feature requests and bug reports. Do not submit support requests here.
Steps to reproduce and a minimal demo of the problem
What steps should we try in your demo to see the problem?
Current behavior
On
*.ts
file change comiler in console shows following error.component.ts(27,5): error TS2322: Type 'Timer' is not assignable to type 'number'.
Expected/desired behavior
Like in every
setTimeout
TypeScript tutorial on the web. Excpect it to returnnumber
type result, notTimer
.The text was updated successfully, but these errors were encountered: