Hello,

You could have a DepartmentModule in which the DepartmentComponent, 
DepartmentModal and DepartmentTable are delcared. If DepartmentModal and 
DepartmentTable are only used in DepartmentComponent, they don't have to be 
exported in DepartmentModule, only DepartmentComponent has to be exported.

In app.module you will have to import DepartementModule if it is used in 
the app component. If it is used in another component you will have to 
import in its corresponding module and not in the app.module. Otherwise if 
it is associated to a route it can be - and should be - lazy loaded.

Regards,
Arnaud.

References:
Modules: https://angular.io/guide/architecture-modules
Lazy loading: https://angular.io/guide/lazy-loading-ngmodules

On Tuesday, 24 November 2020 at 05:07:36 UTC+1 [email protected] wrote:

> Hello all, 
>
> I am new in angular and come from VueJS, i am a fuse confusing about 
> registration components , 
>
> Is it angular have only option that we can register all of created 
> component in to app.module.ts as global with unique selector name 
>
> any options i can register a couple of component in to specific component 
> class like Vuejs.
>
> Let say , I have DepartmentComponent class as parent then i just want to 
> register this tow child DepartmentModal and DepartmentTable without 
> declarations in app.modules.js
>
> Thanks all
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/52d1b77b-1ff0-430b-8754-42907452446dn%40googlegroups.com.

Reply via email to