Is it important to import all component in app.module.ts ?












0














suppose i have three component i.e. componentA,componentB,componentC



so is that important to import all three component ? reason ?



like below in




app.module.ts




@NgModule({
declarations: [**componentA**,**componentB**,**componentC** ],
entryComponents: [**componentA**,**componentB**,**componentC**]


Please provide some description










share|improve this question



























    0














    suppose i have three component i.e. componentA,componentB,componentC



    so is that important to import all three component ? reason ?



    like below in




    app.module.ts




    @NgModule({
    declarations: [**componentA**,**componentB**,**componentC** ],
    entryComponents: [**componentA**,**componentB**,**componentC**]


    Please provide some description










    share|improve this question

























      0












      0








      0







      suppose i have three component i.e. componentA,componentB,componentC



      so is that important to import all three component ? reason ?



      like below in




      app.module.ts




      @NgModule({
      declarations: [**componentA**,**componentB**,**componentC** ],
      entryComponents: [**componentA**,**componentB**,**componentC**]


      Please provide some description










      share|improve this question













      suppose i have three component i.e. componentA,componentB,componentC



      so is that important to import all three component ? reason ?



      like below in




      app.module.ts




      @NgModule({
      declarations: [**componentA**,**componentB**,**componentC** ],
      entryComponents: [**componentA**,**componentB**,**componentC**]


      Please provide some description







      angular






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 23 at 6:30









      Sandeep

      5113




      5113
























          2 Answers
          2






          active

          oldest

          votes


















          1














          It depends on your requirements. If you are displaying these components in the first page. It's need to be added in app.module. If you want to loaded these components on subsequent screens. You can opt for Lazy loading Modules.



          Move components to their own module and loaded those on demand. This will definitely improve the app load time performance.



          Regarding Entry Components, Angular complier will compile all the components defined in the HTML template. Entry Components are those that are not defined in template files. We are telling angular compiler to compile those components defined in entry component configuration which will be included in the application at run time.






          share|improve this answer





























            0















            An entry component is any component that Angular loads imperatively, (which means you’re not referencing it in the template), by type. You specify an entry component by bootstrapping it in an NgModule, or including it in a routing definition.




            There are other components as well which are not bootstrapped imperatively i.e, not on entry as the application loads up bootstrapping




            To contrast the two types of components, there are components which are included in the template, which are declarative. Additionally, there are components which you load imperatively; that is, entry components




            Please have a look at this https://angular.io/guide/entry-components






            share|improve this answer





















              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441607%2fis-it-important-to-import-all-component-in-app-module-ts%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              It depends on your requirements. If you are displaying these components in the first page. It's need to be added in app.module. If you want to loaded these components on subsequent screens. You can opt for Lazy loading Modules.



              Move components to their own module and loaded those on demand. This will definitely improve the app load time performance.



              Regarding Entry Components, Angular complier will compile all the components defined in the HTML template. Entry Components are those that are not defined in template files. We are telling angular compiler to compile those components defined in entry component configuration which will be included in the application at run time.






              share|improve this answer


























                1














                It depends on your requirements. If you are displaying these components in the first page. It's need to be added in app.module. If you want to loaded these components on subsequent screens. You can opt for Lazy loading Modules.



                Move components to their own module and loaded those on demand. This will definitely improve the app load time performance.



                Regarding Entry Components, Angular complier will compile all the components defined in the HTML template. Entry Components are those that are not defined in template files. We are telling angular compiler to compile those components defined in entry component configuration which will be included in the application at run time.






                share|improve this answer
























                  1












                  1








                  1






                  It depends on your requirements. If you are displaying these components in the first page. It's need to be added in app.module. If you want to loaded these components on subsequent screens. You can opt for Lazy loading Modules.



                  Move components to their own module and loaded those on demand. This will definitely improve the app load time performance.



                  Regarding Entry Components, Angular complier will compile all the components defined in the HTML template. Entry Components are those that are not defined in template files. We are telling angular compiler to compile those components defined in entry component configuration which will be included in the application at run time.






                  share|improve this answer












                  It depends on your requirements. If you are displaying these components in the first page. It's need to be added in app.module. If you want to loaded these components on subsequent screens. You can opt for Lazy loading Modules.



                  Move components to their own module and loaded those on demand. This will definitely improve the app load time performance.



                  Regarding Entry Components, Angular complier will compile all the components defined in the HTML template. Entry Components are those that are not defined in template files. We are telling angular compiler to compile those components defined in entry component configuration which will be included in the application at run time.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 23 at 7:06









                  Suresh Kumar Ariya

                  4,4131215




                  4,4131215

























                      0















                      An entry component is any component that Angular loads imperatively, (which means you’re not referencing it in the template), by type. You specify an entry component by bootstrapping it in an NgModule, or including it in a routing definition.




                      There are other components as well which are not bootstrapped imperatively i.e, not on entry as the application loads up bootstrapping




                      To contrast the two types of components, there are components which are included in the template, which are declarative. Additionally, there are components which you load imperatively; that is, entry components




                      Please have a look at this https://angular.io/guide/entry-components






                      share|improve this answer


























                        0















                        An entry component is any component that Angular loads imperatively, (which means you’re not referencing it in the template), by type. You specify an entry component by bootstrapping it in an NgModule, or including it in a routing definition.




                        There are other components as well which are not bootstrapped imperatively i.e, not on entry as the application loads up bootstrapping




                        To contrast the two types of components, there are components which are included in the template, which are declarative. Additionally, there are components which you load imperatively; that is, entry components




                        Please have a look at this https://angular.io/guide/entry-components






                        share|improve this answer
























                          0












                          0








                          0







                          An entry component is any component that Angular loads imperatively, (which means you’re not referencing it in the template), by type. You specify an entry component by bootstrapping it in an NgModule, or including it in a routing definition.




                          There are other components as well which are not bootstrapped imperatively i.e, not on entry as the application loads up bootstrapping




                          To contrast the two types of components, there are components which are included in the template, which are declarative. Additionally, there are components which you load imperatively; that is, entry components




                          Please have a look at this https://angular.io/guide/entry-components






                          share|improve this answer













                          An entry component is any component that Angular loads imperatively, (which means you’re not referencing it in the template), by type. You specify an entry component by bootstrapping it in an NgModule, or including it in a routing definition.




                          There are other components as well which are not bootstrapped imperatively i.e, not on entry as the application loads up bootstrapping




                          To contrast the two types of components, there are components which are included in the template, which are declarative. Additionally, there are components which you load imperatively; that is, entry components




                          Please have a look at this https://angular.io/guide/entry-components







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Nov 23 at 6:37









                          Vaibhav Kumar Goyal

                          512411




                          512411






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441607%2fis-it-important-to-import-all-component-in-app-module-ts%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

                              Calculate evaluation metrics using cross_val_predict sklearn

                              Insert data from modal to MySQL (multiple modal on website)