What is the best good practice in angular app ? (latest version) [closed]

Discussão em 'Angular' iniciado por flolaryko, Julho 3, 2025.

  1. flolaryko

    flolaryko Guest

    I will say lot of points for doing a good project angular in his latest version. I say the truth ? I will do summarize.

    STRUCTURE: 3 modules => CORE, FEATURE, SHARED CORE: these as central element like guard, interceptor, authenfication etc... FEATURE: these as principal feature of app. Singular component (not reusable, generic component) SHARED: these as model, service, component (generic, reusable), enum, pipe etc... who are used in all app and several times.

    CODE STYLE Just respect the official doc : https://angular.dev/style-guide

    OTHER Dont give too mutch responsability at a component. Replace all variable who will change in your code by SIGNAL api. Always use strict typing and avoid any as much as possible.Use interfaces or types to ensure data consistency. Use lazy loading and feature-level routing to improve performance. Respect theutility-first CSS. Respect SOLID princip. I avoid to do subdirectory useless if name of file is concrete => A feature was composed by :

    • book.component.hmtl
    • book.component.html
    • book.component.scss
    • book.constant.ts
    • book.model.ts

    what do you think about this? I forgot something important ?

    Continue reading...

Compartilhe esta Página