How would you structure a large Angular application?

Angular testing, tooling and architecture · Experienced

Model answer

Group code by feature, not by type: each feature folder has its own components, services, routes and models, and is lazy loaded. Keep a small core area for app-wide services (auth, interceptors, config) and a shared area for reusable, dumb UI components, pipes and directives that have no feature knowledge.

Rules that scale: smart (container) components fetch data and dumb (presentational) components take inputs and emit outputs; features do not import from each other directly; and public APIs of a feature are exposed through an index file. For very large systems, tools such as Nx help enforce boundaries and speed builds.

Learn this topic

Angular Tutorial: Beginner to Advanced .

Sign in to add your own answer.

More questions