I am working through some examples and learning angular. When a new project is created with the angular cli polyfills.ts is not generated. Has anyone else ran into this issue? Here is the generated file structure.
generated file structure
I have tried manually adding a polyfills.ts file to the src folder but that still does not seem to do the trick.
I am working through some examples and learning angular. When a new project is created with the angular cli polyfills.ts is not generated. Has anyone else ran into this issue? Here is the generated file structure.
generated file structure
I have tried manually adding a polyfills.ts file to the src folder but that still does not seem to do the trick.
Share Improve this question edited Dec 24, 2022 at 5:01 vimuth 5,61248 gold badges91 silver badges124 bronze badges asked Dec 24, 2022 at 3:25 D3uceeD3ucee 811 silver badge4 bronze badges3 Answers
Reset to default 9Since version 15 polyfills.ts is not generated and it is moved directly into angular.json. So you don’t have to add it.
You can add files in polyfills.ts using angular.json file
for this goto angular.json file there you can see polyfills array
where you can import your localize()
**"index": "src/index.html",
"main": "src/main.ts",
"polyfills": [
"zone.js",
"@angular/localize/init"
],
**
Yes, When use use the latest angular v15 , the pollyfills.ts will not get created instead of that if you see that angular.json under pollyfills property you can see the zone has been added. enter image description here