skip to Main Content

I have downloaded with npm the new version of Angular and I haven’t seen the app.module.ts

Has it been eliminated from the project structure?

VS code Files

Please, some help

Best Regards

I have tried creating a new one. It seems odd.

2

Answers


  1. with in recent angular versions angular introduced new feature, where we can create applications with and without modules.

    In version 14 this is developer preview(not ready for production)

    From version-15 this is ready for production.

    In angular Version 17, by default if we create angular app or components by default everything is standaloane. If we need to create app with modules then we need to explicitly pass standalone falg as false.

    To create Angular App – ng new project-name –standalone=false

    If we dont have angular modules that means we are following standalone approach. In this standalone approach we will see new property in component meta data as below.

    checkout my articles

    https://medium.com/@PurpleGreenLemon/angular-hydration-wtf-is-it-and-why-does-it-matter-9152d55547c0

    https://medium.com/@bhargavr445/routing-in-angular-stand-alone-apps-2682b4de756e

    https://medium.com/@bhargavr445/angular-standalone-components-lazy-loading-part-3-9ce7f9c5a131

    https://medium.com/@bhargavr445/angular-standalone-apps-part-4-31df38e41585

    enter image description here

    Login or Signup to reply.
  2. From Angular v17 onwards, Standalone is now the new default for the CLI.

    So when you create a new project you won’t have any modules in it if you don’t specify anything.

    However, it is still possible to create a module-based app by using the --no-standalone flag : ng new --no-standalone

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search