down votefavorite 
<http://stackoverflow.com/questions/42271085/am-i-using-angular-2-modules-correctly#>

I am developing the following demo app:

A user is shown a list of countries (all displayed as a card with basic 
info and image). When a country is clicked they are routed into the detail 
of that country in which I also show a list of attractions for the country 
(e.g. the Eiffel tower and Louvre museum for France).

Countries:

[image: enter image description here] <https://i.stack.imgur.com/47riy.jpg>

Country detail with list of attractions:

[image: enter image description here] <https://i.stack.imgur.com/g9lW3.png>

This is my project structure

/app
  /attractions
    /attraction (COMPONENT)
    /attraction-list (COMPONENT)
    attraction (CLASS)
    attraction.service
    attractions.routing
    attractions.module (EXPORTS 'AttractionListComponent')
  /countries
    /country (COMPONENT)
    /country-detail (COMPONENT, Uses '<attraction-list></attraction-list>')
    /country-list (COMPONENT)
    country (CLASS)
    country.service
    countries.module (IMPORTS AttractionsModule)
    countries.routing
  app.module (IMPORTS CountriesModule)
  app.routing

Everything works but I do have some questions:

   - Is my architecture following good practices? If not, what should I 
   change?
   - Are my module imports correct, e.g. should I import AttractionsModule 
   in the root AppModule (When I did this it complained because CountryDetail 
   couldn't recognise <attraction-list></attraction-list>
   - What will happend when I incorporate lazy loading, how will it affect 
   my setup?

Thanks in advance!

-- 
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 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.

Reply via email to