Is it important to import all component in app.module.ts ?
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
add a comment |
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
add a comment |
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
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
angular
asked Nov 23 at 6:30
Sandeep
5113
5113
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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.
add a comment |
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 23 at 7:06
Suresh Kumar Ariya
4,4131215
4,4131215
add a comment |
add a comment |
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
add a comment |
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
add a comment |
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
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
answered Nov 23 at 6:37
Vaibhav Kumar Goyal
512411
512411
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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