1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

In standalone mode, how to I import a module in Angular 17?

Discussão em 'Angular' iniciado por Turtles, Setembro 15, 2024.

  1. Turtles

    Turtles Guest

    everyone. I've noticed that Angular 17 defaults to the standalone mode, which means it doesn't automatically generate the file app.module.ts... The code below generates an Angular app in standalone mode:

    ng new project-name


    The code below generates an angular app in not-standalone mode:

    ng new project-name --no-standalone


    However, if I'm working with this new standalone version, could someone guide me on which file to use and how to import a module that was previously imported in the app.module.ts file?

    As an example: if I want to import the module BrowserModule from @angular/platform-browser, do I have to import it in all the components that will use it in the component decorator? Because before, I need to import just at the app.module.ts. Or am I missing something here?

    Continue reading...

Compartilhe esta Página