You need to import components where you use them. Usually you have a hierarchy of components where bigger components are composed of smaller components and even bigger components out of these, and so on. Usually you have a few imports in every component.
If you want to build a gallery of all your components and show them on the same page one after the other, then you'd import all of them into the same file but that's quite uncommon. On Sunday, March 13, 2016 at 2:50:07 AM UTC+1, Dave Abbott wrote: > > Following the Heros example / guide on the Angular 2 it has 2 basic > Components which simply get imported into the app.ts file. > > What about real world where you have possibly 100's of components, do you > have to list everyone in the app.ts / js file? > > What if we had HeroPowers, HeroBattles, HeroWeakness, HeroNemesis, > HeroOrigins, HeroShoeSize, HeroEyeColor , Enemies, EnemiesDetails, yes I > know most these could all be in the HeroDetails but if say someone like me > wanted to know the answer to a real world question how would one do such a > crazy thing? > > Thanks all, > > Dave > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
