{"id":1790,"date":"2017-04-28T15:42:47","date_gmt":"2017-04-28T15:42:47","guid":{"rendered":"https:\/\/ionic.io\/blog\/?p=1790"},"modified":"2020-09-22T20:56:37","modified_gmt":"2020-09-22T20:56:37","slug":"ionic-and-lazy-loading-pt-1","status":"publish","type":"post","link":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1","title":{"rendered":"Ionic and Lazy Loading Pt 1"},"content":{"rendered":"<p>Hi there folks! When we were working on release 3.0.0, our main goal was to add lazy loading to the framework and make it as easy as possible. While we are still labeling lazy loading as a <em>beta\/non-default<\/em> setting, many developers who are adding lazy loading to their apps are asking question regarding best practices and examples. I thought this warranted a post on the subject to dive how to set up an app for lazy loading.<\/p>\n<p><!--more--><\/p>\n<blockquote><p>\n  Note: the approach to lazy loading here is for version 3.0.0 and up. Since lazy loading is still beta\/experimental, the details of this may change in the future.\n<\/p><\/blockquote>\n<h3>The main module<\/h3>\n<p>Lazy loading sounds like a complicated process, but actually is very straight forward. Conceptually, we&#8217;re taking one segment of code, a chunk, and loading it on demand as the app requests it. This is a very framework agnostic take on things, and the finer details here come in the form of <code>NgModules<\/code> for Ionic apps. <code>NgModules<\/code> are the way we can organize our app&#8217;s pages, and separate them out into different chunks.<\/p>\n<p><!--more--><\/p>\n<p>Let&#8217;s take this one piece at a time and use a blank starter app to get our bearings.<\/p>\n<pre><code class=\"language-bash\">ionic start lazyLoadingBlank blank\ncd lazyLoadingBlank\n<\/code><\/pre>\n<p>Now if we open our <code>src\/app\/app.module.ts<\/code> file, we can inspect the default <code>NgModule<\/code>:<\/p>\n<pre><code class=\"language-typescript\">import { MyApp } from &#039;.\/app.component&#039;;\nimport { HomePage } from &#039;..\/pages\/home\/home&#039;;\n@NgModule({\n  declarations: [MyApp, HomePage],\n  imports: [ ... ],\n  bootstrap: [IonicApp],\n  entryComponents: [MyApp, HomePage],\n  providers: [ ... ]\n})\nexport class AppModule {}\n<\/code><\/pre>\n<p>We can see here that we&#8217;re importing the <code>MyApp<\/code> component and the <code>HomePage<\/code> component. Now we want to remove the <code>HomePage<\/code> component from this module, and load it only when we need it. So we can remove the <code>HomePage<\/code> reference in <code>declarations<\/code> and <code>entryComponents<\/code>, as well as the import statement.<\/p>\n<p>So how can we have <code>HomePage<\/code> lazily loaded? We can provide it with it&#8217;s own <code>NgModule<\/code> which will encapsulate everything that the component needs to function.<\/p>\n<p>Let&#8217;s create a new file <code>src\/pages\/home\/home.module.ts<\/code> and scaffold it out.<\/p>\n<pre><code class=\"language-typescript\">import { NgModule } from &#039;@angular\/core&#039;;\nimport { IonicPageModule } from &#039;ionic-angular&#039;;\nimport { HomePage } from &#039;.\/home&#039;;\n@NgModule({\n  declarations: [HomePage],\n  imports: [IonicPageModule.forChild(HomePage)],\n})\nexport class HomePageModule { }\n<\/code><\/pre>\n<p>There&#8217;s not a lot going on here, but <code>IonicPageModule<\/code> is probably something new. Similar to <code>IonicModule<\/code> in the main <code>app.module.ts<\/code>, this tells Ionic what component it should load or provide for this chunk. We can export an empty class and wrap up our module. The last part we need to do now is decorate our <code>HomePage<\/code> component.<\/p>\n<p>In <code>src\/pages\/home\/home.ts<\/code> let&#8217;s add the <code>@IonicPage<\/code> decorator.<\/p>\n<pre><code class=\"language-typescript\">&lt;br \/&gt;import { Component } from &#039;@angular\/core&#039;;\nimport { IonicPage } from &#039;ionic-angular&#039;;\n@IonicPage()\n@Component(... )\nexport class HomePage { ... }\n<\/code><\/pre>\n<p>This <code>IonicPage<\/code> decorator is how Ionic generates the proper mappings and URL slugs for your app at build time. <code>IonicPage<\/code> has a <a href=\"https:\/\/ionicframework.com\/docs\/api\/navigation\/IonicPage\/\">few options<\/a> you can pass to it, but for now we won&#8217;t worry about them. All we need to know is that when we want to navigate or reference this component in our code, we can pass the string <code>HomePage<\/code> instead of a reference to the class directly.<\/p>\n<p>Speaking of, we have the last bit of cleaning up to do. In <code>src\/app\/app.component.ts<\/code> we have an import statement and reference to <code>HomePage<\/code>. Let&#8217;s remove the import statement, and then for <code>rootPage<\/code>, we can set it to <code>&#039;HomePage&#039;<\/code>.<\/p>\n<pre><code class=\"language-typescript\">rootPage:any = &#039;HomePage&#039;;\n<\/code><\/pre>\n<p>Congratulations! You have now gone through the process of lazy loading the Home page!<\/p>\n<p>Ok, so at a basic level, there&#8217;s not a whole lot going on here, it&#8217;s mostly centered around organizing your code, and creating <code>NgModule<\/code>s for the pages you want lazy loaded, and adding the <code>@IonicPage<\/code> decorator to the component.<\/p>\n<p>I&#8217;ve put together some examples on how this can work for something a bit more complicated, like a Tabs based app.<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mhartington\/lazyLoadingBlank\">Lazy Loaded Blank<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mhartington\/lazyLoadTabs\">Lazy Loaded Tabs<\/a><\/li>\n<\/ul>\n<h3>Cool, so why bother?<\/h3>\n<p>Now that we&#8217;re lazy loading <code>HomePage<\/code>, what can we expect to see? If we start to inspect our app, we can see what we&#8217;re sending over the network.<\/p>\n<p><a href=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-27-at-4.01.46-PM.png\"><img loading=\"lazy\" decoding=\"async\" width=\"2298\" height=\"612\" data-src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-27-at-4.01.46-PM.png\" alt=\"Screen Shot 2017-04-27 at 4.01.46 PM\" class=\"aligncenter size-full wp-image-1791 lazyload\" data-srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-27-at-4.01.46-PM.png 2298w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-27-at-4.01.46-PM-300x80.png 300w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-27-at-4.01.46-PM-768x205.png 768w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-27-at-4.01.46-PM-1024x273.png 1024w\" data-sizes=\"auto, (max-width: 2298px) 100vw, 2298px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 2298px; --smush-placeholder-aspect-ratio: 2298\/612;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" width=\"2298\" height=\"612\" src=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-27-at-4.01.46-PM.png\" alt=\"Screen Shot 2017-04-27 at 4.01.46 PM\" class=\"aligncenter size-full wp-image-1791\" srcset=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-27-at-4.01.46-PM.png 2298w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-27-at-4.01.46-PM-300x80.png 300w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-27-at-4.01.46-PM-768x205.png 768w, https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-27-at-4.01.46-PM-1024x273.png 1024w\" sizes=\"auto, (max-width: 2298px) 100vw, 2298px\" \/><\/noscript><\/a><\/p>\n<p>If we look at what we&#8217;re sending over the network, we have our <code>main.js<\/code> bundle (which includes our root app component, angular, and our initial dependencies) and then <code>0.main.js<\/code>, which is just our <code>HomePage<\/code>. Our main chunk is now much smaller, and can be loaded much faster. Same goes for our Home chunk, the code being sent over is only what that chunk requires, so it loads much faster.<\/p>\n<p>Now it&#8217;s important to note, that this does not mean our apps final bundle size is smaller, but we&#8217;re distributing the bytes and only loading what is needed.<\/p>\n<p>Now our small app may seem a bit contrived, but as apps start to grow, the ability to lazy load additional components becomes much more important. Consider apps with 50+ different pages and many more UI components. Loading these all up front is very resource expensive. Instead, if you can only load 2-4 different components up front and lazy load the rest, users will have a much better experience.<\/p>\n<h3>What&#8217;s next<\/h3>\n<p>We&#8217;ve really only scratched the lazy loading surface and concepts behind it. In a follow-up post, we&#8217;ll go over how we can structure our app so we can better support lazy loading of: Component, Directives, and Pipes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi there folks! When we were working on release 3.0.0, our main goal was to add lazy loading to the framework and make it as easy as possible. While we are still labeling lazy loading as a beta\/non-default setting, many developers who are adding lazy loading to their apps are asking question regarding best practices [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":1795,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"publish_to_discourse":"","publish_post_category":"","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"","discourse_permalink":"","wpdc_publishing_response":"","wpdc_publishing_error":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[60,3,25],"class_list":["post-1790","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-all","tag-angular","tag-ionic","tag-tutorials"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.0 (Yoast SEO v23.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ionic and Lazy Loading Pt 1 - Ionic Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ionic and Lazy Loading Pt 1\" \/>\n<meta property=\"og:description\" content=\"Hi there folks! When we were working on release 3.0.0, our main goal was to add lazy loading to the framework and make it as easy as possible. While we are still labeling lazy loading as a beta\/non-default setting, many developers who are adding lazy loading to their apps are asking question regarding best practices [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1\" \/>\n<meta property=\"og:site_name\" content=\"Ionic Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-28T15:42:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-09-22T20:56:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/tenor-1.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"324\" \/>\n\t<meta property=\"og:image:height\" content=\"324\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"Mike Hartington\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mhartington\" \/>\n<meta name=\"twitter:site\" content=\"@ionicframework\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mike Hartington\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#article\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1\"},\"author\":{\"name\":\"Mike Hartington\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/c8c92b04d526adb925ea514c619a267b\"},\"headline\":\"Ionic and Lazy Loading Pt 1\",\"datePublished\":\"2017-04-28T15:42:47+00:00\",\"dateModified\":\"2020-09-22T20:56:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1\"},\"wordCount\":780,\"commentCount\":43,\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/tenor-1.gif\",\"keywords\":[\"Angular\",\"Ionic\",\"Tutorials\"],\"articleSection\":[\"All\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1\",\"url\":\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1\",\"name\":\"Ionic and Lazy Loading Pt 1 - Ionic Blog\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#primaryimage\"},\"thumbnailUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/tenor-1.gif\",\"datePublished\":\"2017-04-28T15:42:47+00:00\",\"dateModified\":\"2020-09-22T20:56:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#primaryimage\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/tenor-1.gif\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/tenor-1.gif\",\"width\":324,\"height\":324},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ionic.io\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ionic and Lazy Loading Pt 1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ionic.io\/blog\/#website\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"name\":\"ionic.io\/blog\",\"description\":\"Build amazing native and progressive web apps with the web\",\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ionic.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ionic.io\/blog\/#organization\",\"name\":\"Ionic\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"width\":1920,\"height\":854,\"caption\":\"Ionic\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/ionicframework\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/c8c92b04d526adb925ea514c619a267b\",\"name\":\"Mike Hartington\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/08\/mike-headshot-2-smaller-150x150.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/08\/mike-headshot-2-smaller-150x150.png\",\"caption\":\"Mike Hartington\"},\"description\":\"Director of Developer Relations\",\"sameAs\":[\"https:\/\/twitter.com\/mhartington\",\"https:\/\/x.com\/mhartington\"],\"url\":\"https:\/\/ionic.io\/blog\/author\/mike\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Ionic and Lazy Loading Pt 1 - Ionic Blog","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:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1","og_locale":"en_US","og_type":"article","og_title":"Ionic and Lazy Loading Pt 1","og_description":"Hi there folks! When we were working on release 3.0.0, our main goal was to add lazy loading to the framework and make it as easy as possible. While we are still labeling lazy loading as a beta\/non-default setting, many developers who are adding lazy loading to their apps are asking question regarding best practices [&hellip;]","og_url":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1","og_site_name":"Ionic Blog","article_published_time":"2017-04-28T15:42:47+00:00","article_modified_time":"2020-09-22T20:56:37+00:00","og_image":[{"width":324,"height":324,"url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/tenor-1.gif","type":"image\/gif"}],"author":"Mike Hartington","twitter_card":"summary_large_image","twitter_creator":"@mhartington","twitter_site":"@ionicframework","twitter_misc":{"Written by":"Mike Hartington","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#article","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1"},"author":{"name":"Mike Hartington","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/c8c92b04d526adb925ea514c619a267b"},"headline":"Ionic and Lazy Loading Pt 1","datePublished":"2017-04-28T15:42:47+00:00","dateModified":"2020-09-22T20:56:37+00:00","mainEntityOfPage":{"@id":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1"},"wordCount":780,"commentCount":43,"publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"image":{"@id":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#primaryimage"},"thumbnailUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/tenor-1.gif","keywords":["Angular","Ionic","Tutorials"],"articleSection":["All"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1","url":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1","name":"Ionic and Lazy Loading Pt 1 - Ionic Blog","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#primaryimage"},"image":{"@id":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#primaryimage"},"thumbnailUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/tenor-1.gif","datePublished":"2017-04-28T15:42:47+00:00","dateModified":"2020-09-22T20:56:37+00:00","breadcrumb":{"@id":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#primaryimage","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/tenor-1.gif","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/tenor-1.gif","width":324,"height":324},{"@type":"BreadcrumbList","@id":"https:\/\/ionic.io\/blog\/ionic-and-lazy-loading-pt-1#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ionic.io\/blog"},{"@type":"ListItem","position":2,"name":"Ionic and Lazy Loading Pt 1"}]},{"@type":"WebSite","@id":"https:\/\/ionic.io\/blog\/#website","url":"https:\/\/ionic.io\/blog\/","name":"ionic.io\/blog","description":"Build amazing native and progressive web apps with the web","publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ionic.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ionic.io\/blog\/#organization","name":"Ionic","url":"https:\/\/ionic.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","width":1920,"height":854,"caption":"Ionic"},"image":{"@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/ionicframework"]},{"@type":"Person","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/c8c92b04d526adb925ea514c619a267b","name":"Mike Hartington","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/08\/mike-headshot-2-smaller-150x150.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2018\/08\/mike-headshot-2-smaller-150x150.png","caption":"Mike Hartington"},"description":"Director of Developer Relations","sameAs":["https:\/\/twitter.com\/mhartington","https:\/\/x.com\/mhartington"],"url":"https:\/\/ionic.io\/blog\/author\/mike"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2017\/04\/tenor-1.gif","_links":{"self":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/1790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/comments?post=1790"}],"version-history":[{"count":0,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/1790\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media\/1795"}],"wp:attachment":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media?parent=1790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/categories?post=1790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/tags?post=1790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}