angular/integration/ng-add-localize
Alan Agius c9541f4c49 fix(localize): update ng add schematic to support Angular CLI version 15 (#47763)
Prior to this, the `@angular/localize/init` was added as a polyfill which caused the `@angular/localize` types not to be included in the TypeScript program which caused errors such as the below:

```
Error: src/app/app.component.ts:9:11 - error TS2304: Cannot find name '$localize'.
```

With the recent changes in the CLI (https://github.com/angular/angular-cli/pull/24032), adding `@angular/localize/init` as polyfil or in the `main.server.ts` is no longer necessary. Instead we add this as a TypeScript type. When users are running in JIT mode, we add `@angular/localize/init` as an additional entrypoint.

This change also exposes the `$localize` method as a global when importing `@angular/localize`.

Closes #47677

PR Close #47763
2022-10-17 09:58:21 +02:00
..
src fix(localize): update ng add schematic to support Angular CLI version 15 (#47763) 2022-10-17 09:58:21 +02:00
.browserslistrc test: setup minimal CLI project for ng-add localize integration test (#44016) 2021-11-04 18:54:54 +00:00
.gitignore test: setup minimal CLI project for ng-add localize integration test (#44016) 2021-11-04 18:54:54 +00:00
angular.json test: remove defaultProject workspace option (#45410) 2022-03-24 10:49:57 -07:00
BUILD.bazel build: setup test targets for integration tests with new rule (#44238) 2021-12-08 13:42:41 -05:00
package.json test: setup minimal CLI project for ng-add localize integration test (#44016) 2021-11-04 18:54:54 +00:00
README.md test: setup minimal CLI project for ng-add localize integration test (#44016) 2021-11-04 18:54:54 +00:00
tsconfig.app.json test: setup minimal CLI project for ng-add localize integration test (#44016) 2021-11-04 18:54:54 +00:00
tsconfig.json test: setup minimal CLI project for ng-add localize integration test (#44016) 2021-11-04 18:54:54 +00:00
yarn.lock test: setup minimal CLI project for ng-add localize integration test (#44016) 2021-11-04 18:54:54 +00:00

NgAddLocalize

This project was generated with Angular CLI version 13.0.0-next.7.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.