{"id":1607,"date":"2018-11-27T16:20:33","date_gmt":"2018-11-27T15:20:33","guid":{"rendered":"https:\/\/www.thecodecampus.de\/blog\/?p=1607"},"modified":"2025-04-17T13:32:02","modified_gmt":"2025-04-17T11:32:02","slug":"improve-performance-with-virtual-scrolling","status":"publish","type":"post","link":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/","title":{"rendered":"Improve performance with virtual scrolling in Angular &#8211; HowTo"},"content":{"rendered":"\r\n<p>Since the release of Angular 7, the Angular CDK includes a feature that can improve the performance of your application dramatically. Virtual scrolling is highly beneficial for dealing with a lot of data in tables or lists. You can improve performance for large lists in Angular with the Angular CDK virtual scrolling component.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">What is virtual scrolling<\/h2>\r\n\r\n\r\n\r\n<p>I could explain what virtual scrolling is, but I couldn&#8217;t do it as good as some other folks, so I&#8217;m going to recommend that you watch the following talk instead. The first 5 minutes should give you a rough idea.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-has-aspect-ratio wp-embed-aspect-16-9\">\r\n<div class=\"wp-block-embed__wrapper\">https:\/\/www.youtube.com\/watch?v=UtD41bn6kJ0<\/div>\r\n<\/figure>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">What is the Angular CDK<\/h2>\r\n\r\n\r\n\r\n<p>The feature is not included in the <strong>@angular\/core<\/strong> package but is bundled within the <a href=\"https:\/\/material.angular.io\/cdk\/categories\">Angular CDK<\/a>.<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p>The Component Dev Kit (CDK) is a set of tools that implement common interaction patterns whilst being unopinionated about their presentation.<\/p>\r\n<cite>https:\/\/material.angular.io\/cdk\/categories<\/cite><\/blockquote>\r\n\r\n\r\n\r\n<p>In more simpler terms you could say, that the CDK is the backbone of <a href=\"https:\/\/material.angular.io\/\">Angular Material<\/a> and provides the base functionality without including any styling.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Virtual scrolling performance demo time<\/h2>\r\n\r\n\r\n\r\n<p>The code we are looking at in this post is hosted on Stackblitz:\u00a0<a href=\"https:\/\/stackblitz.com\/edit\/angular-virtual-table-scrolling\">https:\/\/stackblitz.com\/edit\/angular-virtual-table-scrolling<\/a><\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Start with a plain Angular table<\/h3>\r\n\r\n\r\n\r\n<p>We&#8217;re starting with a pretty simple example of a table using a <strong>*ngFor<\/strong> loop<\/p>\r\n\r\n<pre class=\"lang:xhtml decode:true\">  &lt;table&gt;\r\n    &lt;thead&gt;\r\n      &lt;tr&gt;\r\n        &lt;td&gt;Name&lt;\/td&gt;\r\n        &lt;td&gt;ID&lt;\/td&gt;\r\n      &lt;\/tr&gt;\r\n    &lt;\/thead&gt;\r\n    &lt;tbody&gt;\r\n      &lt;tr *ngFor=\"let row of tableData\"&gt;\r\n        &lt;td&gt;{{row.name}}&lt;\/td&gt;\r\n        &lt;td&gt;{{row.id}}&lt;\/td&gt;\r\n      &lt;\/tr&gt;\r\n    &lt;\/tbody&gt;\r\n  &lt;\/table&gt;<\/pre>\r\n\r\n<p>We define the <strong>tableData<\/strong> property in the corresponding component.ts file.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>\/\/ app.component.ts\r\nimport { Component, OnInit} from '@angular\/core';\r\n\r\n@Component({\r\n  selector: 'my-app',\r\n  templateUrl: '.\/app.component.html',\r\n  styleUrls: [ '.\/app.component.css' ]\r\n})\r\nexport class AppComponent implements OnInit  {\r\n  name = 'Angular';\r\n\r\n  tableData = [];\r\n\r\n  ngOnInit() {\r\n    for (let i = 0; i &lt; 1000; i++) {\r\n      this.tableData.push({\r\n        name: 'Name' + i,\r\n        id: i\r\n      });\r\n    }\r\n  }\r\n}<\/code><\/pre>\r\n\r\n\r\n<a href=\"https:\/\/www.thecodecampus.de\/schulungen\/angular\" style=\"display: inline-block;\">\r\n<picture>\r\n<source srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_anne_WP_big.png\" media=\"(min-width: 1024px)\">\r\n<source srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_anne_WP_medium.png\" media=\"(min-width: 600px)\">\r\n<img decoding=\"async\" src=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_anne_WP_small.png\" alt=\"Angular Schulungen\" class=\"alignnone size-full wp-image-38\">\r\n<\/picture>\r\n<\/a>\r\n\r\n\r\n<h3 class=\"wp-block-heading\">\u00a0<\/h3>\r\n<h3>Introducing virtual scrolling<\/h3>\r\n\r\n\r\n\r\n<p>The Angular CDK provides a <a href=\"https:\/\/material.angular.io\/cdk\/scrolling\/overview\">scrolling component<\/a>. We&#8217;re now going to add it to our plain table in 4 simple steps.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">1. Add the dependency<\/h4>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">npm install\u00a0@angular\/cdk --save<\/pre>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">2. Add ScrollingModule<\/h4>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>\/\/app.module.ts\r\nimport { ScrollingModule } from '@angular\/cdk\/scrolling';\r\n\r\n@NgModule({\r\n  imports:      [ ScrollingModule ],\r\n})\r\nexport class AppModule { }<\/code><\/pre>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">3. Add virtual scrolling component<\/h4>\r\n\r\n\r\n\r\n<p>Step 2 is to add the <strong>&lt;cdk-virtual-scroll-viewport&gt;<\/strong> element around the markup of your table. We need to provide the attribute\u00a0<strong>[itemSize]=&#8221;heightOfRowInPx&#8221;<\/strong>\u00a0that tells the scrolling component how high each row is.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">4. Replace *ngFor with *cdkVirtualFor<\/h4>\r\n\r\n\r\n\r\n<p>Instead of using <strong>*ngFor<\/strong> we&#8217;re going to use <strong>*cdkVirtualFor.<\/strong>\u00a0 This way the virtual scrolling works as intended.<\/p>\r\n\r\n<pre class=\"lang:xhtml decode:true editor-rich-text__tinymce mce-content-body\">&lt;cdk-virtual-scroll-viewport [itemSize]=\"20\"&gt;\r\n  &lt;table&gt;\r\n    &lt;thead&gt;\r\n      &lt;tr&gt;\r\n        &lt;td&gt;Name&lt;\/td&gt;\r\n        &lt;td&gt;ID&lt;\/td&gt;\r\n      &lt;\/tr&gt;   \r\n    &lt;\/thead&gt;\r\n    &lt;tbody&gt;\r\n      &lt;tr *cdkVirtualFor=\"let row of tableData\"&gt;\r\n        &lt;td&gt;{{row.name}}&lt;\/td&gt;\r\n        &lt;td&gt;{{row.id}}&lt;\/td&gt;\r\n      &lt;\/tr&gt;\r\n    &lt;\/tbody&gt;\r\n  &lt;\/table&gt;\r\n&lt;\/cdk-virtual-scroll-viewport&gt;<\/pre>\r\n\r\n<h3 class=\"wp-block-heading\">Result<\/h3>\r\n\r\n\r\n\r\n<p>If we inspect the DOM changes after introducing the <strong>&lt;cdk-virtual-scroll-viewport&gt;<\/strong>\u00a0we see that the browser is removing and adding DOM Nodes as we are scrolling.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1092\" height=\"508\" class=\"wp-image-1608\" src=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2018\/11\/virtual-table-scrolling.gif\" alt=\"improve performance with virtual scrolling\" \/>\r\n<figcaption>Angular adds\/removes DOM Nodes to achieve a performant virtual scrolling<\/figcaption>\r\n<\/figure>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Improvements \/ Hints<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Depending on the layout of your application you might need to set a height for the <strong>&lt;cdk-virtual-scroll-viewport&gt;<\/strong> element.<\/li>\r\n<li>Use the <strong>trackBy<\/strong>\u00a0function of <strong>*ngFor<\/strong> whenever you can like <a href=\"https:\/\/netbasal.com\/angular-2-improve-performance-with-trackby-cc147b5104e5\">shown here<\/a>.<\/li>\r\n<li>For more information on how to optimize performance when loading big and expensive lists, we recommend you our <a href=\"https:\/\/www.thecodecampus.de\/blog\/optimize-the-performances-of-large-tables-in-your-angular-application\/\">blog post<\/a> regarding this topic.<\/li>\r\n<\/ul>\r\n<h2>Alternatives<\/h2>\r\n<p>One thing that is obvious while using angular CDK virtual scrolling, is that it comes with quiet a lot of magic. The options to fine tune the virtual scrolling behaviour are limited. If you are interested in alternatives to optimize the loading of large lists or lists with expensive elements, we encourage you to have a look at <a href=\"https:\/\/www.npmjs.com\/package\/ngx-infinite-scroll\">ngx-infinite-scroll<\/a>.<\/p>\r\n<p>Infinite-scroll has the same goal as virtual scrolling, yet the strategy differs a bit. While virtual scrolling only renders the list the visible elements, infinite scroll loads the elements lazy. So if I scroll down the list and reach a defined area at the end of the already loaded elements, it triggers a function that loads the next x elements. The same can be implemented for scrolling up.<\/p>\r\n<p>One big benefit of using infinite scrolling is the control you get over the displayed items. So if you want all loaded items to be available after they have been loaded lazily, infinite scroll is your friend.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Further Reading<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><a href=\"https:\/\/material.angular.io\/cdk\/categories\">Angular CDK<\/a><\/li>\r\n<li><a href=\"https:\/\/material.angular.io\/\">Angular Material<\/a><\/li>\r\n<li><a href=\"https:\/\/stackblitz.com\/edit\/angular-virtual-table-scrolling\">Stackblitz Example<\/a><\/li>\r\n<li><a href=\"https:\/\/netbasal.com\/angular-2-improve-performance-with-trackby-cc147b5104e5\">TrackBy function<\/a><\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>&nbsp;<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Since the release of Angular 7, the Angular CDK includes a feature that can improve the performance of your application dramatically. Virtual scrolling is highly beneficial for dealing with a lot of data in tables or lists. You can improve performance for large lists in Angular with the Angular CDK virtual scrolling component. What is [&#8230;]<br \/><a class=\"meta-big\" href=\"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/\"> READ MORE<\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73,149,148,139,2,60,150],"tags":[],"class_list":["post-1607","post","type-post","status-publish","format-standard","hentry","category-angular","category-angular-cdk","category-angular-material","category-cdk","category-javascript","category-typescript","category-virtual-scrolling"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Improve performance with virtual scrolling in Angular - HowTo<\/title>\n<meta name=\"description\" content=\"Learn how to use virtual scrolling to improve the performance of your Angular apps using the Angular CDK. \u25ba Step-by-step guide.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Improve performance with virtual scrolling in Angular - HowTo\" \/>\n<meta property=\"og:description\" content=\"Learn how to use virtual scrolling to improve the performance of your Angular apps using the Angular CDK. \u25ba Step-by-step guide.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Development tips and tricks - theCodeCampus Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-27T15:20:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-17T11:32:02+00:00\" \/>\n<meta name=\"author\" content=\"Kai Henzler\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kai Henzler\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/\"},\"author\":{\"name\":\"Kai Henzler\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/person\\\/b9decc610011ed03b2117b5e02032132\"},\"headline\":\"Improve performance with virtual scrolling in Angular &#8211; HowTo\",\"datePublished\":\"2018-11-27T15:20:33+00:00\",\"dateModified\":\"2025-04-17T11:32:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/\"},\"wordCount\":604,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/angular-schulungen_anne_WP_small.png\",\"articleSection\":[\"Angular\",\"Angular CDK\",\"Angular Material\",\"CDK\",\"JavaScript\",\"TypeScript\",\"Virtual Scrolling\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/\",\"name\":\"Improve performance with virtual scrolling in Angular - HowTo\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/angular-schulungen_anne_WP_small.png\",\"datePublished\":\"2018-11-27T15:20:33+00:00\",\"dateModified\":\"2025-04-17T11:32:02+00:00\",\"description\":\"Learn how to use virtual scrolling to improve the performance of your Angular apps using the Angular CDK. \u25ba Step-by-step guide.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/angular-schulungen_anne_WP_small.png\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/angular-schulungen_anne_WP_small.png\",\"width\":720,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/improve-performance-with-virtual-scrolling\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Improve performance with virtual scrolling in Angular &#8211; HowTo\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\",\"name\":\"Web Development tips and tricks - theCodeCampus Blog\",\"description\":\"Tips, tricks, and experiences about developing web and mobile applications with Angular, TypeScript, and Testing.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\",\"name\":\"theCodeCampus\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch.jpg\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch.jpg\",\"width\":156,\"height\":156,\"caption\":\"theCodeCampus\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/person\\\/b9decc610011ed03b2117b5e02032132\",\"name\":\"Kai Henzler\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/kai-henzler-tcc-author-96x96.webp\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/kai-henzler-tcc-author-96x96.webp\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/kai-henzler-tcc-author-96x96.webp\",\"caption\":\"Kai Henzler\"},\"description\":\"I'm a web developer who is around since the AngularJS days (10+ years). My focus is on teaching others how to write simple and maintainable code.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/kai-henzler-58484599\\\/\"],\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/author\\\/khenzler\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Improve performance with virtual scrolling in Angular - HowTo","description":"Learn how to use virtual scrolling to improve the performance of your Angular apps using the Angular CDK. \u25ba Step-by-step guide.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/","og_locale":"en_US","og_type":"article","og_title":"Improve performance with virtual scrolling in Angular - HowTo","og_description":"Learn how to use virtual scrolling to improve the performance of your Angular apps using the Angular CDK. \u25ba Step-by-step guide.","og_url":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/","og_site_name":"Web Development tips and tricks - theCodeCampus Blog","article_published_time":"2018-11-27T15:20:33+00:00","article_modified_time":"2025-04-17T11:32:02+00:00","author":"Kai Henzler","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kai Henzler","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/#article","isPartOf":{"@id":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/"},"author":{"name":"Kai Henzler","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/person\/b9decc610011ed03b2117b5e02032132"},"headline":"Improve performance with virtual scrolling in Angular &#8211; HowTo","datePublished":"2018-11-27T15:20:33+00:00","dateModified":"2025-04-17T11:32:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/"},"wordCount":604,"commentCount":7,"publisher":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#organization"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/#primaryimage"},"thumbnailUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_anne_WP_small.png","articleSection":["Angular","Angular CDK","Angular Material","CDK","JavaScript","TypeScript","Virtual Scrolling"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/","url":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/","name":"Improve performance with virtual scrolling in Angular - HowTo","isPartOf":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/#primaryimage"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/#primaryimage"},"thumbnailUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_anne_WP_small.png","datePublished":"2018-11-27T15:20:33+00:00","dateModified":"2025-04-17T11:32:02+00:00","description":"Learn how to use virtual scrolling to improve the performance of your Angular apps using the Angular CDK. \u25ba Step-by-step guide.","breadcrumb":{"@id":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/#primaryimage","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_anne_WP_small.png","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_anne_WP_small.png","width":720,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/www.thecodecampus.de\/blog\/improve-performance-with-virtual-scrolling\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.thecodecampus.de\/blog\/"},{"@type":"ListItem","position":2,"name":"Improve performance with virtual scrolling in Angular &#8211; HowTo"}]},{"@type":"WebSite","@id":"https:\/\/www.thecodecampus.de\/blog\/#website","url":"https:\/\/www.thecodecampus.de\/blog\/","name":"Web Development tips and tricks - theCodeCampus Blog","description":"Tips, tricks, and experiences about developing web and mobile applications with Angular, TypeScript, and Testing.","publisher":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.thecodecampus.de\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.thecodecampus.de\/blog\/#organization","name":"theCodeCampus","url":"https:\/\/www.thecodecampus.de\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch.jpg","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch.jpg","width":156,"height":156,"caption":"theCodeCampus"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/person\/b9decc610011ed03b2117b5e02032132","name":"Kai Henzler","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/06\/kai-henzler-tcc-author-96x96.webp","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/06\/kai-henzler-tcc-author-96x96.webp","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/06\/kai-henzler-tcc-author-96x96.webp","caption":"Kai Henzler"},"description":"I'm a web developer who is around since the AngularJS days (10+ years). My focus is on teaching others how to write simple and maintainable code.","sameAs":["https:\/\/www.linkedin.com\/in\/kai-henzler-58484599\/"],"url":"https:\/\/www.thecodecampus.de\/blog\/author\/khenzler\/"}]}},"_links":{"self":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/1607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/comments?post=1607"}],"version-history":[{"count":57,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/1607\/revisions"}],"predecessor-version":[{"id":3406,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/1607\/revisions\/3406"}],"wp:attachment":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/media?parent=1607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/categories?post=1607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/tags?post=1607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}