Files
Alan Agius 881ecb0936 fix(localize): add triple slash type reference on @angular/localize on `ng add (#48502)
This commits add a triple slash type reference to the `main.ts` of the project when running `ng add @angular/localize`. This is purely needed for IDE purposes so that `$localize` is available globally. For the compilations `@angular/localize` types are adding the the respective TS configs files.

This commits also add better support for using `@angular/localize` in `/// <reference types="@angular/localize" />`. To support this we need to move the global definition outside of a barrel file and into the index.ts file. Without this change the `$localize` method will not available globally when using triple slash type references.

Closes #48434

PR Close #48502
2023-01-04 11:50:45 -08:00
..

@angular/localize schematic for ng add

This schematic will be executed when an Angular CLI user runs ng add @angular/localize.

It will search their angular.json file, and add types: ["@angular/localize"] in the TypeScript configuration files of the project.

If the user specifies that they want to use $localize at runtime then the dependency will be added to the depdendencies section of package.json rather than in the devDependencies which is the default.