Closed as not planned
Description
Describe the problem that you experienced
When opening the stackblitz exemple for Dynamic component loader there is a TS error.
Error: src/app/ad-banner.component.ts:45:5 - error TS2322: Type 'Timer' is not assignable to type 'number'.
45 this.interval = setInterval(() => {
~~~~~~~~~~~~~
Because setInterval
is from NodeJS
and not window
.
Enter the URL of the topic with the problem
https://angular.io/generated/live-examples/dynamic-component-loader/stackblitz.html
Describe what you were looking for in the documentation
Opening the page https://angular.io/guide/dynamic-component-loader
Describe the actions that led you to experience the problem
Clicking the link live exemple
Describe what you want to experience that would fix the problem
this.interval = window.setInterval(() => {
this.loadComponent();
}, 3000);
Add a screenshot if that helps illustrate the problem
No response
If this problem caused an exception or error, please paste it here
No response
If the problem is browser-specific, please specify the device, OS, browser, and version
No response
Provide any additional information here in as much as detail as you can
No response