Angular Project Architecture: A Step-by-Step Guide

Опубликовано: 17 Июнь 2024
на канале: Code with Yogesh
2,646
63

Angular scalable project architecture | Folder structure best practices | Enterprise applications

#angular #angulartraining #angular17 #angular_developer #angular_js

What is shared module ?
What is core Module ?
What is feature module ?
Where we should import core and shared module.


In an Angular application, the SharedModule and CoreModule serve distinct purposes and should be imported accordingly. Here's how to handle them:

Shared Module
The SharedModule is designed to contain components, directives, and pipes that will be used across multiple modules in the application. Typically, it does not provide services (since services in a shared module could lead to multiple instances of the same service).

Core Module
The CoreModule is intended to hold singleton services that will be used throughout the application. Typically, it contains services that should be instantiated once for the entire application (e.g., authentication services, HTTP interceptors).

Where to Import:

Import CoreModule only once in the root AppModule. This prevents multiple instances of services.


Смотрите видео Angular Project Architecture: A Step-by-Step Guide онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Code with Yogesh 17 Июнь 2024. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 2,646 раз и оно понравилось 63 посетителям.