{"id":5643,"date":"2022-05-01T17:00:34","date_gmt":"2022-05-01T15:00:34","guid":{"rendered":"https:\/\/www.angulararchitects.io\/?p=5643"},"modified":"2022-05-01T17:00:34","modified_gmt":"2022-05-01T15:00:34","slug":"angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components","status":"publish","type":"post","link":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/","title":{"rendered":"Angular&#8217;s Future Without NgModules &#8211; Part 1: Lightweight Solutions Using Standalone Components"},"content":{"rendered":"<div class=\"wp-post-series-box series-angulars-future-without-ngmodules wp-post-series-box--expandable\">\n\t\t\t<input id=\"collapsible-series-angulars-future-without-ngmodules69d0cb0740681\" class=\"wp-post-series-box__toggle_checkbox\" type=\"checkbox\">\n\t\n\t<label\n\t\tclass=\"wp-post-series-box__label\"\n\t\t\t\t\tfor=\"collapsible-series-angulars-future-without-ngmodules69d0cb0740681\"\n\t\t\ttabindex=\"0\"\n\t\t\t\t>\n\t\t<p class=\"wp-post-series-box__name wp-post-series-name\">\n\t\t\tThis is post 1 of 8 in the series <em>&ldquo;Angular&#039;s Future with Standalone Components&rdquo;<\/em>\t\t<\/p>\n\t\t\t<\/label>\n\n\t\t\t<div class=\"wp-post-series-box__posts\">\n\t\t\t<ol>\n\t\t\t\t\t\t\t\t\t<li><span class=\"wp-post-series-box__current\">Angular&#8217;s Future Without NgModules &#8211; Part 1: Lightweight Solutions Using Standalone Components<\/span><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/\">Angular&#8217;s Future Without NgModules &#8211; Part 2: What Does That Mean for Our Architecture?<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/4-ways-to-prepare-for-angulars-upcoming-standalone-components\/\">4 Ways to Prepare for Angular&#8217;s Upcoming Standalone Components<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/routing-and-lazy-loading-with-standalone-components\/\">Routing and Lazy Loading with Angular&#8217;s Standalone Components<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/angular-elements-web-components-with-standalone-components\/\">Angular Elements: Web Components with Standalone Components<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/the-refurbished-httpclient-in-angular-15-standalone-apis-and-functional-interceptors\/\">The Refurbished HttpClient in Angular 15 &#8211; Standalone APIs and Functional Interceptors<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/testing-angular-standalone-components\/\">Testing Angular Standalone Components<\/a><\/li>\n\t\t\t\t\t\t\t\t\t<li><a href=\"https:\/\/www.angulararchitects.io\/en\/blog\/tutorial-automatically-migrating-to-standalone-components-in-3-steps\/\">Automatic Migration to Standalone Components in 3 Steps<\/a><\/li>\n\t\t\t\t\t\t\t<\/ol>\n\t\t<\/div>\n\t<\/div>\n<p><strong>Update on 2022-05-01<\/strong>: Texts and examples fully updated to use initial Standalone Components support in <em>Angular 14.0.0-next.15<\/em> (instead of just using a shim for simulating them). <\/p>\n<p><strong>Update on 2022-10-09<\/strong>: Updated for <em>Angular 14.2.0<\/em>.<\/p>\n<p><\/p>\n<p>Standalone Components is one of the most exciting new Angular features since quite a time. They allow for working without NgModules and hence are the key for more lightweight and straightforward Angular solutions. A first implementation already landed in  Angular 14 BETA and the Angular Team tries hard to make them available until version 14 is released in the first half of 2022. <\/p>\n<p>In this article series, I'm going to demonstrate how to leverage this innovation. For this, I'm using an example application completely written with Standalone Components.<\/p>\n<blockquote><p>\nThe <strong>\ud83d\udcc2 source code<\/strong> for this can be found in the form of a traditional <a href=\"https:\/\/github.com\/manfredsteyer\/standalone-example-cli\">Angular CLI workspace<\/a> and as an <a href=\"https:\/\/github.com\/manfredsteyer\/standalone-example-nx\">Nx workspace<\/a> that uses libraries as a replacement for NgModules.\n<\/p><\/blockquote>\n<h2>Why Did we Even Get NgModules in the First Place?<\/h2>\n<p>The main reason for initially introducing NgModules was pragmatic: We needed a way to group building blocks that are used together. Not only to increase the convenience for developers, but also for the Angular Compiler whose development lagged a little behind. In the latter case, we are talking about the compilation context. From this context, the compiler learns where the program code is allowed to call which components:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2022\/10\/context.png\" alt=\"NgModules provide the Compilation Context\" \/><\/p>\n<p>However, the community was never really happy with this decision. Having another modular system besides that of EcmaScript didn't feel right. In addition, it raised the entry barrier for new Angular developers. That is why the Angular team designed the new Ivy compiler so that the compiled application works without modules at runtime. Each component compiled with Ivy has its own compilation context. Even if that sounds grandiose, this context is just represented by two arrays that refer to adjacent components, directives, and pipes.<\/p>\n<p>Since the old compiler and the associated execution environment have now been permanently removed from Angular as of Angular 13, it was time to anchor this option in Angular's public API. For some time there has been a design document and an associated RFC [RFC]. Both describe a world where Angular modules are optional. The word optional is important here: Existing code that relies on modules is still supported.<\/p>\n<h2>Getting Started With Standalone Components<\/h2>\n<p>In general, implementing a Standalone Component is easy. Just set the <code>standalone<\/code> flag in the <code>Component<\/code> decorator to <code>true<\/code> and import everything you want to use:<\/p>\n<pre><code class=\"language-typescript\">@Component({\n  standalone: true,\n  selector: &#039;app-root&#039;,\n  imports: [\n    RouterOutlet,\n    NavbarComponent,\n    SidebarComponent,\n  ],\n  templateUrl: &#039;.\/app.component.html&#039;,\n  styleUrls: [&#039;.\/app.component.css&#039;]\n})\nexport class AppComponent {\n    [...]\n}<\/code><\/pre>\n<p>The <code>imports<\/code> define the compilation context: all the other building blocks the Standalone Components is allowed to use. For instance, you use it to import further Standalone Component, but also existing NgModules.<\/p>\n<p>The exhaustive listing of all these building blocks makes the component self-sufficient and thus increases its reusability in principle. It also forces us to think about the component's dependencies. Unfortunately, this task turns out to be extremely monotonous and time consuming.<\/p>\n<p>Therefore, there are considerations to implement a kind of auto-import in the Angular Language Service used by the IDEs. Analogous to the auto-import for TypeScript modules, the IDE of choice could also suggest placing the corresponding entry in the <code>imports<\/code> array the first time a component, pipe or directive is used in the template.<\/p>\n<h2>The Mental Model<\/h2>\n<p>The underlying mental model helps to better understand Standalone Components. In general, you can imagine a Standalone Component as a component with its very own NgModule:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/05\/mental-model.png\" alt=\"Mental Model\" \/><\/p>\n<p>This is similar to <a href=\"https:\/\/twitter.com\/LayZeeDK\">Lars Nielsen<\/a>'s SCAM pattern. However, while SCAM uses an explicit module, here we only talk about a thought one. <\/p>\n<p>While this mental model is useful for understanding Angular's behavior, it's also important to see that Angular doesn't implement Standalone Components that way underneath the covers.<\/p>\n<h2>Pipes, Directives, and Services<\/h2>\n<p>Analogous to standalone components, there are also standalone pipes and standalone directives. For this purpose, the <code>pipe<\/code> and <code>directive<\/code> decorators also get a <code>standalone<\/code> property. This is what a standalone pipe will look alike:<\/p>\n<pre><code class=\"language-typescript\">@Pipe ({\n  standalone: true,\n  name: &#039;city&#039;,\n  pure: true\n})\nexport class CityPipe implements PipeTransform {\n\n  transform (value: string, format: string): string {[\u2026]}\n\n}<\/code><\/pre>\n<p>And here is an example for a standalone directive:<\/p>\n<pre><code class=\"language-typescript\">@Directive ({\n    standalone: true,\n    selector: &#039;input [appCity]&#039;,\n    providers: [\u2026]\n})\nexport class CityValidator implements Validator {\n\n    [...]\n\n}<\/code><\/pre>\n<p>Thanks to tree-shakable providers, on the other hand, services have worked without modules for quite a time. For this purpose the property <code>providedIn<\/code> has to be used:<\/p>\n<pre><code class=\"language-typescript\">@Injectable ({\n  providedIn: &#039;root&#039;\n})\nexport class FlightService {[\u2026]}<\/code><\/pre>\n<p>In a later part of this article series, we will look more closely to dependency injection in a world of Standalone Components. However, to anticipate one key point already now: Using modern tree-shakable providers instead of old-style providers in NgModules helps a lot when migrating to Standalone Components.<\/p>\n<p>The Angular team recommends, to use <code>providedIn: &#039;root&#039;<\/code> whenever possible. It might come as a surprise, but <code>providedIn: &#039;root&#039;<\/code> also works with lazy loading: If you only use a service in lazy parts of your application, it is loaded alongside them.<\/p>\n<h2>Bootstrapping Standalone Components<\/h2>\n<p>Until now, modules were also required for bootstrapping, especially since Angular expected a module with a bootstrap component. Thus, this so called <code>AppModule<\/code> or &quot;root module&quot; defined the main component alongside its compilation context. <\/p>\n<p>With Standalone Components, it will be possible to bootstrap a single component. For this, Angular provides a method <code>bootstrapApplication<\/code> which can be used in <code>main.ts<\/code>:<\/p>\n<pre><code class=\"language-typescript\">\/\/ main.ts\n\nimport { bootstrapApplication } from &#039;@angular\/platform-browser&#039;;\nimport { provideAnimations } from &#039;@angular\/platform-browser\/animations&#039;;\nimport { AppComponent } from &#039;.\/app\/app.component&#039;;\nimport { APP_ROUTES } from &#039;.\/app\/app.routes&#039;;\nimport { provideRouter } from &#039;@angular\/router&#039;;\nimport { importProvidersFrom } from &#039;@angular\/core&#039;;\n\n[...]\n\nbootstrapApplication(AppComponent, {\n  providers: [\n    importProvidersFrom(HttpClientModule),\n    provideRouter(APP_ROUTES),\n    provideAnimations(),\n    importProvidersFrom(TicketsModule),\n    importProvidersFrom(LayoutModule),\n  ]\n});<\/code><\/pre>\n<p>The first argument passed to <code>bootstrapApplication<\/code> is the main component. Here, it's our <code>AppComponent<\/code>. Via the second argument, we pass application-wide service providers. These are the providers, you would register with the <code>AppModule<\/code> when going with NgModules.<\/p>\n<p>The provided helper function <code>importProvidersFrom<\/code> allows bridging the gap to existing NgModules. Please also note, that <code>importProvidersFrom<\/code> works with both NgModules but also <code>ModuleWithProviders<\/code> as returned by methods like <code>forRoot<\/code> and <code>forChild<\/code>. <\/p>\n<p>While this allows to immediately leverage existing NgModule-based APIs, we will see more and more functions that replace the usage of <code>importProvidersFrom<\/code> in the future. For instance, to register the router with a given configuration, the function <code>provideRouter<\/code> is used. Similarly, provideAnimations setup up the Animation module.<\/p>\n<h2>Compatibility With Existing Code<\/h2>\n<p>As discussed above, according to the mental model, a Standalone Component is just a component with its very own NgModule. This is also the key for the compatibility with existing code still using NgModules. <\/p>\n<p>On the one side, we can import whole NgModules into a Standalone Component:<\/p>\n<pre><code class=\"language-typescript\">import { Component, OnInit } from &#039;@angular\/core&#039;;\nimport { TicketsModule } from &#039;..\/tickets\/tickets.module&#039;;\n\n@Component({\n    selector: &#039;app-next-flight&#039;,\n    standalone: true,\n    imports: [\n        \/\/ Existing NgModule imported \n        \/\/ in this standalone component\n        TicketsModule\n    ],\n    [...]\n})\nexport class NextFlightComponent implements OnInit {\n    [...]\n}<\/code><\/pre>\n<p>But on the other side, we can also import a Standalone Component (Directive, Pipe) into an existing NgModule:<\/p>\n<pre><code class=\"language-typescript\">@NgModule({\n  imports: [\n    CommonModule,\n\n    \/\/ Imported Standalone Component:\n    FlightCardComponent,\n    [...]\n  ],\n  declarations: [\n    MyTicketsComponent\n  ],\n  [...]\n})\nexport class TicketsModule { }<\/code><\/pre>\n<p>Interestingly, standalone components are <strong>imported<\/strong> like modules and not declared like classic components. This may be confusing at first glance, but it totally fits the mental model that views a standalone component a component with its very own NgModule.<\/p>\n<p>Also, declaring a traditional component defines a strong whole-part relationship: A traditional component can only be declared by one module and then, it belongs to this module. However, a standalone component doesn't belong to any NgModule but it can be reused in several places. Hence, using <code>imports<\/code> here really makes sense.<\/p>\n<h2>Side Note: The CommonModule<\/h2>\n<p>Doubtless, one of the most known NgModules in Angular was the <code>CommonModule<\/code>. It contains built-in directives like <code><em>ngIf<\/code> or <code><\/em>ngFor<\/code> and built-in pipes like <code>async<\/code> or <code>json<\/code>. While you can still import the whole <code>CommonModule<\/code>, meanwhile it's also possible to just import the needed directives and pipes:<\/p>\n<pre><code class=\"language-typescript\">import { \n    AsyncPipe, \n    JsonPipe, \n    NgForOf, \n    NgIf \n} from &quot;@angular\/common&quot;;\n\n[...]\n\n@Component({\n  standalone: true,\n  imports: [\n    \/\/ CommonModule, \n    NgIf,\n    NgForOf,\n    AsyncPipe,\n    JsonPipe,\n\n    FormsModule, \n    FlightCardComponent,\n    CityValidator,\n  ],\n  selector: &#039;flight-search&#039;,\n  templateUrl: &#039;.\/flight-search.component.html&#039;\n})\nexport class FlightSearchComponent implements OnInit {\n    [...]\n}<\/code><\/pre>\n<p>This is possible, because the Angular team made Standalone Directives and Standalone Pipes out of the building blocks provided by the <code>CommonModule<\/code>. Importing these building blocks in a fine grained way will be especially interesting once IDEs provide auto-imports for standalone components. In this case, the first usage of an building block like <code>*ngIf<\/code> will make the IDE to add it to the <code>imports<\/code> array. <\/p>\n<blockquote><p>\nAs we will see in a further part of this series, meanwhile also the <code>RouterModule<\/code> comes with Standalone building-blocks. Hence, we can directly import RouterOutlet instead of going with the whole <code>RouterModule<\/code>. When writing this, this was not yet possible for other modules like the <code>FormsModule<\/code> or the <code>HttpClientModule<\/code>.\n<\/p><\/blockquote>\n<h2>Interim Conclusion: Standalone Components -- and now?<\/h2>\n<p>So far we've seen how to use Standalone Components to make our Angular applications more lightweight. We've also seen that the underlying mental model guarantees compatibility with existing code. <\/p>\n<p>However, now the question arises how this all will influence our application structure and architecture. The next part of this short series will shed some light on this.<\/p>\n<p><strong>&raquo; Next Part:<\/strong> <a href=\"https:\/\/www.angulararchitects.io\/aktuelles\/angulars-future-without-ngmodules-part-2-what-does-that-mean-for-our-architecture\/\">Angular's Future Without NgModules - Part 2: What Does That Mean for Our Architecture?<\/a><\/p>\n<h2>More on Architecture?<\/h2>\n<p>When architecting enterprise-scale Angular applications, several additional questions come in mind:<\/p>\n<ul>\n<li>According to which criteria can we sub-divide a huge application into libraries and sub-domains?<\/li>\n<li>Which access restrictions make sense?<\/li>\n<li>Which proven patterns should we use?<\/li>\n<li>How can we evolve our solution towards micro frontends?<\/li>\n<\/ul>\n<p>Our free eBook (about 100 pages) covers all these questions and more:<\/p>\n<p><a href=\"https:\/\/www.angulararchitects.io\/book\"><img decoding=\"async\" src=\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2022\/12\/cover-5th-small.png\" alt=\"free ebook\"><\/a><\/p>\n<p>Feel free to <a href=\"https:\/\/www.angulararchitects.io\/book\">download it here<\/a> now!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Standalone Components make the future of Angular applications more lightweight. We don&#8217;t need NgModules anymore. Instead, we just use EcmaScript modules.<\/p>\n","protected":false},"author":9,"featured_media":5639,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"footnotes":""},"categories":[18],"tags":[],"class_list":["post-5643","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","post_series-angulars-future-without-ngmodules"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Angular&#039;s Future Without NgModules - Part 1: Lightweight Solutions Using Standalone Components - ANGULARarchitects<\/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:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angular&#039;s Future Without NgModules - Part 1: Lightweight Solutions Using Standalone Components - ANGULARarchitects\" \/>\n<meta property=\"og:description\" content=\"Standalone Components make the future of Angular applications more lightweight. We don&#039;t need NgModules anymore. Instead, we just use EcmaScript modules.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/\" \/>\n<meta property=\"og:site_name\" content=\"ANGULARarchitects\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-01T15:00:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/blog01.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Manfred Steyer, GDE\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/blog01.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@daniel\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Manfred Steyer, GDE\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/\"},\"author\":{\"name\":\"Manfred Steyer, GDE\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/15628efa7af4475ffaaeeb26c5112951\"},\"headline\":\"Angular&#8217;s Future Without NgModules &#8211; Part 1: Lightweight Solutions Using Standalone Components\",\"datePublished\":\"2022-05-01T15:00:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/\"},\"wordCount\":1415,\"publisher\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/stanalone-bg.jpg\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/\",\"url\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/\",\"name\":\"Angular's Future Without NgModules - Part 1: Lightweight Solutions Using Standalone Components - ANGULARarchitects\",\"isPartOf\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/stanalone-bg.jpg\",\"datePublished\":\"2022-05-01T15:00:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#primaryimage\",\"url\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/stanalone-bg.jpg\",\"contentUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/stanalone-bg.jpg\",\"width\":2000,\"height\":1333},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.angulararchitects.io\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Angular&#8217;s Future Without NgModules &#8211; Part 1: Lightweight Solutions Using Standalone Components\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#website\",\"url\":\"https:\/\/www.angulararchitects.io\/en\/\",\"name\":\"ANGULARarchitects\",\"description\":\"AngularArchitects.io\",\"publisher\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.angulararchitects.io\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#organization\",\"name\":\"ANGULARarchitects\",\"alternateName\":\"SOFTWAREarchitects\",\"url\":\"https:\/\/www.angulararchitects.io\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg\",\"contentUrl\":\"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg\",\"width\":644,\"height\":216,\"caption\":\"ANGULARarchitects\"},\"image\":{\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/github.com\/angular-architects\",\"https:\/\/www.linkedin.com\/company\/angular-architects\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/15628efa7af4475ffaaeeb26c5112951\",\"name\":\"Manfred Steyer, GDE\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0b59539674d8b71ea1c1f4764b11244b5f499203f1d11b40f37d8f3f90be033?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0b59539674d8b71ea1c1f4764b11244b5f499203f1d11b40f37d8f3f90be033?s=96&d=mm&r=g\",\"caption\":\"Manfred Steyer, GDE\"},\"sameAs\":[\"https:\/\/x.com\/daniel\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Angular's Future Without NgModules - Part 1: Lightweight Solutions Using Standalone Components - ANGULARarchitects","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.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/","og_locale":"en_US","og_type":"article","og_title":"Angular's Future Without NgModules - Part 1: Lightweight Solutions Using Standalone Components - ANGULARarchitects","og_description":"Standalone Components make the future of Angular applications more lightweight. We don't need NgModules anymore. Instead, we just use EcmaScript modules.","og_url":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/","og_site_name":"ANGULARarchitects","article_published_time":"2022-05-01T15:00:34+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/blog01.jpg","type":"image\/jpeg"}],"author":"Manfred Steyer, GDE","twitter_card":"summary_large_image","twitter_image":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/blog01.jpg","twitter_creator":"@daniel","twitter_misc":{"Written by":"Manfred Steyer, GDE","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#article","isPartOf":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/"},"author":{"name":"Manfred Steyer, GDE","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/15628efa7af4475ffaaeeb26c5112951"},"headline":"Angular&#8217;s Future Without NgModules &#8211; Part 1: Lightweight Solutions Using Standalone Components","datePublished":"2022-05-01T15:00:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/"},"wordCount":1415,"publisher":{"@id":"https:\/\/www.angulararchitects.io\/en\/#organization"},"image":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#primaryimage"},"thumbnailUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/stanalone-bg.jpg","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/","url":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/","name":"Angular's Future Without NgModules - Part 1: Lightweight Solutions Using Standalone Components - ANGULARarchitects","isPartOf":{"@id":"https:\/\/www.angulararchitects.io\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#primaryimage"},"image":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#primaryimage"},"thumbnailUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/stanalone-bg.jpg","datePublished":"2022-05-01T15:00:34+00:00","breadcrumb":{"@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#primaryimage","url":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/stanalone-bg.jpg","contentUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2021\/12\/stanalone-bg.jpg","width":2000,"height":1333},{"@type":"BreadcrumbList","@id":"https:\/\/www.angulararchitects.io\/en\/blog\/angulars-future-without-ngmodules-lightweight-solutions-on-top-of-standalone-components\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.angulararchitects.io\/en\/"},{"@type":"ListItem","position":2,"name":"Angular&#8217;s Future Without NgModules &#8211; Part 1: Lightweight Solutions Using Standalone Components"}]},{"@type":"WebSite","@id":"https:\/\/www.angulararchitects.io\/en\/#website","url":"https:\/\/www.angulararchitects.io\/en\/","name":"ANGULARarchitects","description":"AngularArchitects.io","publisher":{"@id":"https:\/\/www.angulararchitects.io\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.angulararchitects.io\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.angulararchitects.io\/en\/#organization","name":"ANGULARarchitects","alternateName":"SOFTWAREarchitects","url":"https:\/\/www.angulararchitects.io\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg","contentUrl":"https:\/\/www.angulararchitects.io\/wp-content\/uploads\/2023\/07\/AA-Logo-RGB-horizontal-inside-knowledge-black.svg","width":644,"height":216,"caption":"ANGULARarchitects"},"image":{"@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/github.com\/angular-architects","https:\/\/www.linkedin.com\/company\/angular-architects\/"]},{"@type":"Person","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/15628efa7af4475ffaaeeb26c5112951","name":"Manfred Steyer, GDE","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.angulararchitects.io\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0b59539674d8b71ea1c1f4764b11244b5f499203f1d11b40f37d8f3f90be033?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0b59539674d8b71ea1c1f4764b11244b5f499203f1d11b40f37d8f3f90be033?s=96&d=mm&r=g","caption":"Manfred Steyer, GDE"},"sameAs":["https:\/\/x.com\/daniel"]}]}},"_links":{"self":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts\/5643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/comments?post=5643"}],"version-history":[{"count":0,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/posts\/5643\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/media\/5639"}],"wp:attachment":[{"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/media?parent=5643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/categories?post=5643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.angulararchitects.io\/en\/wp-json\/wp\/v2\/tags?post=5643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}