0

I am watching a tutorial based on Angular 12.2.5. and I tried to follow him but using the current version 15.0.4

It looks like I am missing a lot of files and folder compared to him like the whole environment folder or a file that is called app-routing.module.ts is missing in my /src/app folder

I'm just confused if newer version including this data in some other files now days or if something is wrong with my version.

zuzuzuu
  • 87
  • 6

1 Answers1

1

There were natuarally changes between your Angular version (15.0.4) and the one from the tutorial (12.2.5).

Many, if not most, core concepts should still be applicable between those versions.

The absence of app-routing.module.ts file should be due to a missing --routing flag during the creation of the project. You can still manually create it and import it into your app.module.ts file, like you can probably see in the tutorial you're following.

In version 15 the Angular team decided to remove certain config files, including:

  • .browserslistrc
  • polyfills.ts
  • test.ts
  • karma.config.js
  • environment.ts
  • environment.prod.ts

The reasoning behind it is that apparently many developers weren't using these files. You can still add them manually and use them, it's just the CLI that doesn't generate them anymore. You need to keep in mind that certain files require additional changes inside the project like inside the angular.json file for example.

forbiddencoding
  • 329
  • 1
  • 9
  • Do you have any source where they state that reasoning? Would like to know what alternative they are using instead when it comes to environment files. – Tommi Dec 20 '22 at 14:10
  • 2
    [Here](https://youtu.be/j2_NnV7nU6s?t=1666) is the YouTube launch event Q&A timestamp in which they're addressing this topic. There is no alternative. It has been removed when starting a new project, but can be manually added at any time just like it has been before in previous version. – forbiddencoding Dec 20 '22 at 14:18
  • Thank you! Yes i understand that it's removed now but if there were developers not using this in the first place what did they do instead Is what i'm curious about. – Tommi Dec 20 '22 at 14:44