Compare commits

...

106 Commits

Author SHA1 Message Date
Jessica Janiuk b79ad226b2 release: cut the v15.0.0 release 2022-11-16 09:43:27 -08:00
Jeremy Elbourn bc97322641 docs: add host directives guide (#48057)
PR Close #48057
2022-11-15 20:37:00 +00:00
Jessica Janiuk 4cfb06086b release: cut the v15.0.0-rc.4 release 2022-11-14 12:05:46 -08:00
Alan Agius 933d481a0e docs: remove version 12 from actively supported versions (#48041)
Version 12 is no longer in LTS.

PR Close #48041
2022-11-14 19:28:12 +00:00
ced edea15f2c6 fix(common): export the IMAGE_CONFIG token (#48051)
The token introduced in 4fde292bb5 was not exported publicly.

PR Close #48051
2022-11-14 19:27:17 +00:00
Andrew Kushnir a1b6610c3d test(common): add e2e tests for the fill mode checks in the NgOptimizedImage directive (#48036)
This commit adds extra e2e tests for the fill mode checks in the NgOptimizedImage directive to make
sure a warning is logged in a console.

PR Close #48036
2022-11-14 09:20:40 -08:00
Alex Castle 945432e3fa fix(common): Warn on fill ngOptimizedImage without height (#48036)
Add a warning if a fill-mode image is rendered without height. This is a common occurence if the user doesn't properly set the 'position' attribute of the parent element.

PR Close #48036
2022-11-14 09:20:40 -08:00
Alex Castle 629ebad8eb docs(common): Refine NgOptimizedImage docs (#48035)
Make several changes to the structure of the documentation, based on early feedback about the readability and usefulness of the docs.

PR Close #48035
2022-11-11 15:47:04 -08:00
Andrew Kushnir 154ca82f7b docs(core): add an error details page for unsafe <iframe> bindings (#48027)
PR Close #48027
2022-11-11 11:28:35 -08:00
Mujo Osmanovic 0c0550b536 docs(docs-infra): Fix typo in documentation for standalone components (#48026)
PR Close #48026
2022-11-11 08:48:36 -08:00
Alex Castle 449d29b701 fix(common): Add fetchpriority to ngOptimizedImage preloads (#48010)
Add fetchpriority='high' to ngOptimizedImage preloads to so their priority matches the priority of the image element itself

PR Close #48010
2022-11-10 17:36:40 +00:00
Andrew Kushnir 6a9b1e11c2 release: cut the v15.0.0-rc.3 release 2022-11-09 13:40:24 -08:00
Andrew Scott 6ab9f03baf docs(router): small adjustments to router docs (#48009)
* Update extractedUrl documentation to point to the correct extract method
* Remove authService.redirectUrl from tour of heroes (it's not used anywhere)

PR Close #48009
2022-11-09 10:56:40 -08:00
Alan Agius 37a25486cf fix(core): add zone.js version 0.12.x as a valid peer dependency (#48002)
This commit adds `zone.js` version `0.12.x` as a valid peer dependency

PR Close #48002
2022-11-09 09:54:12 -08:00
Andrew Kushnir 28f289b825 fix(core): hardening attribute and property binding rules for <iframe> elements (#47964)
This commit updates the logic related to the attribute and property binding rules for <iframe> elements. There is a set of <iframe> attributes that may affect the behavior of an iframe and this change enforces that these attributes are only applied as static attributes, making sure that they are taken into account while creating an <iframe>.

If Angular detects that some of the security-sensitive attributes are applied as an attribute or property binding, it throws an error message, which contains the name of an attribute that is causing the problem and the name of a Component where an iframe is located.

BREAKING CHANGE:

Existing iframe usages may have security-sensitive attributes applied as an attribute or property binding in a template or via host bindings in a directive. Such usages would require an update to ensure compliance with the new stricter rules around iframe bindings.

PR Close #47964
2022-11-09 00:47:57 -08:00
Angular Robot 54d0981871 build: update dependency google-closure-compiler to v20221102 (#47992)
See associated pull request for more information.

PR Close #47992
2022-11-08 12:39:21 -08:00
Andrew Scott 2efcc26bb6 docs(router): Update router docs to use guard functions instead of @Injectable (#47989)
This commit updates various router docs to use the functional style
guards instead of the `@Injectable` style.

PR Close #47989
2022-11-08 11:35:08 -08:00
Alex Castle a93a1a5759 docs(common): Merge two ngOptimizedImage docs into one (#47990)
Move the old image-directive-setup.md documentation page to be a section on the main image-directive.md docs page

PR Close #47990
2022-11-08 10:36:06 -08:00
Dylan Hunn ae29f98c20 fix(forms): Runtime error pages must begin with leading zero (#47991)
I recently checked in a new error guide. The corresponding page must have a leading zero because it is a runtime error. Otherwise links to this error guide will be invalid.

PR Close #47991
2022-11-08 10:35:09 -08:00
Andrew Scott 02918c9b5a test(router): Move test for redirect under correct describe block (#47993)
This moves a redirect test to be grouped with other redirect tests.

PR Close #47993
2022-11-08 10:34:23 -08:00
Dylan Hunn 2625dc1312 fix(forms): Improve a very commonly viewed error message by adding a guide. (#47969)
[A Github issue](https://github.com/angular/angular/issues/43821) about an arcane-sounding Forms error is one of the repo's top-ten most visited pages. This converts the error to `RuntimeErrorCode` and adds a dedicated guide to explain how to solve it.

PR Close #47969
2022-11-07 16:00:06 -08:00
Kristiyan Kostadinov 3e490fab1b refactor(core): remove duplicate createRenderer call (#47981)
Fixes that we were calling `createRenderer` even though we had one already. This likely wasn't a performance issue since the renderer factory caches the renderer, but it's still better to reuse it to avoid confusion in the future.

Fixes #47980.

PR Close #47981
2022-11-07 12:33:26 -08:00
Matthieu Riegler 76b64f659c refactor(router): Simplify routerLink selector (#47941)
Since the merge of `RouterLinkWithHref` into `RouterLink` there is no need for a complex selector.

PR Close #47941
2022-11-07 12:32:43 -08:00
Andrew Scott fb7318cb86 refactor(router): Remove code to support relativeLinkResolution (#47933)
The public API for enabling this option has already been removed. This change
updates the internal Router code to not include any logic to support it.

PR Close #47933
2022-11-07 09:26:19 -08:00
Paul Gschwendtner 08ee9b4b26 build: update ng-dev configuration to account for caretaker note label change (#47987)
The caretaker note label has been renamed to the new standardized label
name. This commit updates the ng-dev caretaker check configuration to
account for this.

Also the merge assistance queue query is updated to only show PRs marked
as ready for merge. Other PRs with just a caretaker note should not be
of interest for the caretaker yet.

PR Close #47987
2022-11-07 09:25:40 -08:00
Alan Agius 46c0576efe docs: update polyfills sections for version 15 (#47975)
This commit updates the polyfills section in the browsers support guide. The `polyfills.ts` is no longer generated in version 15+

PR Close #47975
2022-11-07 09:25:04 -08:00
Albert Szekely b8a6f7491b fix(router): fix redirectTo on named outlets - resolves #33783 (#47927)
fix(router): fix redirectTo on named outlets - resolves #33783

PR Close #47927
2022-11-04 09:30:32 -07:00
Andrew Scott 8f38bbaf26 refactor(router): Warn when provideRoutes is used without provideRouter (#47896)
Due to being only 1 letter away from `provideRouter`, it is quite
possible that developers may accidentally use `provideRoutes` rather
than `provideRouter` in the `boostrapApplication` function. This change
will warn developers when `provideRoutes` is used without the `Router`.

PR Close #47896
2022-11-04 09:29:24 -07:00
Andrew Scott 80dff09134 docs(router): deprecate provideRoutes function (#47896)
This function is too similar in name to the new `provideRouter` and can
lead to misconfiguring the router. The function itself is just a small
wrapper around `{provide: ROUTES, multi: true, useValue: routes}`. It is
rarely necessary to provide routes in this way. The harm `provideRoutes`
will cause due to being only 1 letter away from `provideRouter` vastly
outweighs the benefit of a slightly shorter provider.

PR Close #47896
2022-11-04 09:29:24 -07:00
Alex Rickabaugh e7b48da713 fix(http): rename withLegacyInterceptors to withInterceptorsFromDi (#47901)
This rename reflects what the function actually does. Although the intention
is still not to have two different interceptor mechanisms, that is now
communicated in the docs for the function instead of in its name.

Fixes #47764

PR Close #47901
2022-11-03 17:54:04 -07:00
Alex Rickabaugh fe0075bdea docs(http): add public API tags and jsdoc for provideHttpClient (#47901)
This commit adds documentation and API tagging for `provideHttpClient` and
the `with*` feature functions.

PR Close #47901
2022-11-03 17:54:03 -07:00
Doug Parker 1d02e6ad68 build: add --keep_going to components tests. (#47958)
This configures CI to run all the tests and report all the failures instead of aborting after the first one.

PR Close #47958
2022-11-03 17:52:40 -07:00
Alan Agius b4706cf3e8 docs: add searchKeywords in testing guide (#47953)
This is to push up the page in search results when searching for these terms.

Ex: currently when searching using the term `test` this page is displayed at the middle of the results.

PR Close #47953
2022-11-03 17:51:59 -07:00
Peter Scriven cc4f5e6663 docs: fix lint errors for change detection guides (#47952)
PR Close #47952
2022-11-03 17:51:27 -07:00
Alan Agius f35c46a894 docs: remove CI testing setups (#47940)
This section is unnecessary given that all is needed for the user is to run `ng test`, and is also tricky to maintain (Node was hard coded to v14 still).

We have no mechanism of testing or verifying these setups, and we have no motivation to do so.

Users should see their CI providers documentation Any preconfigured Node setup is going to suggest `ng test`, which should "just work" for Angular.

PR Close #47940
2022-11-03 17:50:52 -07:00
Alan Agius f9888d928e docs: update testing document to include karma config (#47940)
In version 15, the Angular CLI will no longer generate a `karma.conf.js` by default.

This commit updates the testing document to include an example of how to include a custom `karma.conf.js`.  Also, we update several parts of the documentation which were outdated.

PR Close #47940
2022-11-03 17:50:51 -07:00
Andrew Kushnir c097c5fbcb refactor(common): improve the NgOptimizedImage error message related to changing inputs (#47926)
This commit updates the error message thrown by the NgOptimizedImage directive, when it detects a situation
when inputs change after initial rendering.

The list of inputs was also updated to include all inputs added recently.

PR Close #47926
2022-11-03 17:50:22 -07:00
Alan Agius a016508768 docs: remove redirects to no longer existing page (#47929)
This redirect is broken as this page no longer exists.

PR Close #47929
2022-11-03 17:47:55 -07:00
Markus Eckstein 164a1713d5 docs: fix missing word (#47876)
PR Close #47876
2022-11-03 17:47:28 -07:00
Alan Agius 604d89eef9 docs: update examples to reflect changes in Angular CLI version 15. (#47904)
These changes include
- Remove the usage of `enableProdMode`
- Remove `test.ts`, `polyfills.ts`, `karma.conf.js` and environment files which are no longer generated by default

PR Close #47904
2022-11-03 17:46:46 -07:00
Alan Agius 83cec3de51 docs: update analytics gathering documentation (#47840)
Currently there are 3 pages for analytics gathering information. Most of the information is duplicate.

With this change we remove the duplicate pages and outdated content to reflect the changes in version 15.

PR Close #47840
2022-11-03 17:45:35 -07:00
abergquist 7a33d395b3 docs: made code appear better, etc. (#47336)
Made code appear better and resolved some minor grammatical opportunities/issues.
PR Close #47336
2022-11-03 17:44:57 -07:00
Andrew Kushnir 8a19bc63ea release: cut the v15.0.0-rc.2 release 2022-11-03 17:32:10 -07:00
Andrew Kushnir 173dde7681 Revert "fix(core): hardening rules related to the attribute order on iframe elements (#47935)" (#47961)
This reverts commit d4b3c0b47c.

PR Close #47961
2022-11-03 17:03:43 -07:00
Andrew Kushnir d4b3c0b47c fix(core): hardening rules related to the attribute order on iframe elements (#47935)
This commit updates the logic related to the attribute order on iframes and makes the rules more strict. There is a set of iframe attributes that may affect the behavior of an iframe, this change enforces that these attributes are applied before an `src` or `srcdoc` attributes are applied to an iframe, so that they are taken into account.

If Angular detects that some of the attributes are set after the `src` or `srcdoc`, it throws an error message, which contains the name of ann attribute that is causing the problem and the name of a Component where an iframe is located. In most cases, it should be enough to change the order of attributes in a template to move the `src` or `srcdoc` ones to the very end.

BREAKING CHANGE:

Existing iframe usages may have `src` or `srcdoc` preceding other attributes. Such usages may need to be updated to ensure compliance with the new stricter rules around iframe bindings.

PR Close #47935
2022-11-02 07:23:42 -07:00
mgechev e63574774e docs: update roadmap as of q4 2022 (#47910)
PR Close #47910
2022-11-01 04:46:49 -07:00
Kristiyan Kostadinov d5cd79f885 perf(platform-browser): resolve memory leak when using animations with shadow DOM (#47903)
`AnimationRendererFactory` maintains a map between a renderer delegate and the animations renderer it corresponds to, but the renderers are never removed from the map. This leads to memory leaks when used with the `ShadowDom` view encapsulation, because the specific renderer keeps a references to its shadow root which in turn references all the elements in the view.

These changes resolve the leak by clearing the reference when the animations renderer is destroyed.

Fixes #47892.

PR Close #47903
2022-11-01 04:46:09 -07:00
Alex Rickabaugh e683298be6 docs(core): update standalone docs for provideRouter (#47902)
This commit updates the standalone components guide on AIO to showcase the
new `provideRouter` API. Previously the guide demonstrated configuring the
router via `importProvidersFrom(RouterModule.forRoot(...))`. A new section
was added to ensure `importProvidersFrom` was still shown in an example.

PR Close #47902
2022-11-01 04:45:20 -07:00
Paul Gschwendtner 99597c8c57 refactor(bazel): enable typescript strictness flags for package (#47893)
No longer maintains a separate tsconfig for the Bazel package. This
seems to be a legacy artifact back when ngc-wrapped was put into GitHub.

We now use the canonical repository Bazel tsconfig. This commit also
fixes all strictness-related errors and makes ngc-wrapped compatible.

PR Close #47893
2022-11-01 04:44:29 -07:00
Paul Gschwendtner f99cc40c5d refactor(compiler-cli): update emit signature to support for strongly typed emitCallback (#47893)
Currently `ngc-wrapped` mostly relies on any casts/or disabled
strictness checks to be able to use `tsickle`'s emit callback and
emit result merging for ngtsc. We should change this so that supertypes
of `ts.EmitResult` can be used in these optional callbacks- allowing us
to enable strictness checks in `packages/bazel/...` too.

PR Close #47893
2022-11-01 04:44:29 -07:00
Virginia Dooley 623602fc3a docs: Linting corrections. Restructuring or rewording sentences to be shorter and clearer. (#47897)
PR Close #47897
2022-10-28 02:37:47 -07:00
Alan Agius b3ea67e8a7 docs: improve grammer in CLI command template (#47891)
Before
```
This command has the following commands:
```

Now
```
This command has the following sub-commands:
```

PR Close #47891
2022-10-28 02:29:08 -07:00
Alan Agius 31a7ce1268 fix(platform-server): call onSerialize when state is empty (#47888)
Commit https://github.com/angular/angular/commit/a0b2d364156eed0d33831c37b00ea5c58ff4bbec#diff-3975e0ee5aa3e06ecbcd76f5fa5134612f7fd2e6802ca7d370973bd410aab55cR25-R31 changed the serialization phase logic so
that when the state is empty the script tag is not added to the document. As a side effect, this caused the `toJson` not called which caused the `onSerialize` callbacks also not to be called.
These callbacks are used to provide the value for a key when `toJson` is called. Example: https://github.com/ngrx/platform/issues/101#issuecomment-351998548

Closes #47172

PR Close #47888
2022-10-28 02:27:57 -07:00
Charles Lyding c7bc47c509 docs: update CLI related deprecation information (#47885)
There are no new CLI related deprecations for v15. However, multiple
features listed in the deprecation guide have since been removed and
are now also removed from the relevant sections of the guide.

PR Close #47885
2022-10-27 18:03:16 +02:00
Pawel Kozlowski 96c0e42e61 fix(core): allow readonly arrays for standalone imports (#47851)
Standalone components should support readonly arrays in the
`@Component.imports`.

Fixes #47643

PR Close #47851
2022-10-27 09:29:24 +02:00
Pawel Kozlowski f24da6baad release: cut the v15.0.0-rc.1 release 2022-10-26 20:34:19 +02:00
Andrew Scott ea7ff35b30 Revert "build: add atscott to unavailable list for pullapprove (#47658)" (#47877)
This reverts commit cf88a3ce20.

PR Close #47877
2022-10-26 19:00:55 +02:00
George Kalpakas 603194ee20 build(docs-infra): upgrade cli command docs sources to 50d813140 (#47870)
Updating [angular#15.0.x](https://github.com/angular/angular/tree/15.0.x) from
[cli-builds#15.0.x](https://github.com/angular/cli-builds/tree/15.0.x).

##
Relevant changes in
[commit range](https://github.com/angular/cli-builds/compare/46cb32b90...50d813140):

**Modified**
- help/analytics.json
- help/config.json

PR Close #47870
2022-10-26 17:35:02 +02:00
Angular Robot 5dadec56e6 build: update cross-repo angular dependencies (#47874)
See associated pull request for more information.

PR Close #47874
2022-10-26 16:33:21 +02:00
Angular Robot d75e3da429 build: update bazel setup to v5.7.0 (#47436)
See associated pull request for more information.

PR Close #47436
2022-10-26 15:43:20 +02:00
Angular Robot ebd2ddbbd1 build: update cross-repo angular dependencies (#47846)
See associated pull request for more information.

PR Close #47846
2022-10-26 14:12:24 +02:00
Angular Robot df36537bfd build: update babel dependencies (#47765)
See associated pull request for more information.

PR Close #47765
2022-10-25 21:57:13 +02:00
Angular Robot ed48887068 build: update cross-repo angular dependencies (#47871)
See associated pull request for more information.

PR Close #47871
2022-10-25 15:33:43 +02:00
Kristiyan Kostadinov 2908eba59c fix(platform-server): align server renderer interface with base renderer (#47868)
The `ServerRenderer` wasn't aligned with the `Renderer2` interface which meant that it was still referring to the old `debugInfo` parameters. It also wasn't implementing the `preserveContent` argument of `selectRootElement` which can lead to incosistencies between the server and the client.

Fixes #47844.

PR Close #47868
2022-10-25 14:51:46 +02:00
Alan Agius a8ce8f7fc4 docs: update typescript configuration (#47842)
This commits update the TypeScript configuration for the updated version 15 release.

PR Close #47842
2022-10-25 10:29:37 +02:00
Alan Agius 66eb1425e2 docs: update configuring browser compatibility (#47842)
This commits adds more information about why and how Browserslist is used in the Angular CLI.

PR Close #47842
2022-10-25 10:29:37 +02:00
Alan Agius 61f8522410 docs: update projects file structure (#47841)
With this change we update the file structure to reflect that of new projects in version 15.

PR Close #47841
2022-10-25 10:28:32 +02:00
Pawel Kozlowski c0903acbd4 Revert "fix(forms): don't mutate validators array (#47830)" (#47845)
This reverts commit 0329c13e95.

PR Close #47845
2022-10-25 10:05:18 +02:00
vyom1611 588cd3ed50 docs: removing http-server section in Service worker tour (#47613)
- Based on issue #47583
- Updated docs for Service workers by removing the section which used http-server to use service workers with ng serve
- By changelog of v14.2.0, service workers become compatible with ng serve using feature #23679

PR Close #47613
2022-10-24 15:42:57 +02:00
Kristiyan Kostadinov a99d9d67f3 fix(forms): don't mutate validators array (#47830)
Fixes that the `AbstractControl` was mutating the validators arrays being passed into the constructor an helper methods like `setValidators`.

Fixes #47827.

PR Close #47830
2022-10-24 14:12:56 +02:00
Paul Gschwendtner 6471eafde6 build: update recommended launch vscode config to use proper bazel dist path (#47831)
As of Bazel v5, the `bazel-out` symlink no longer exists. This commit
corrects the path in the VSCode recommended launch configuration. This
helps speed up this launch configuration given less files having to be
explored.

PR Close #47831
2022-10-24 10:42:22 +02:00
onrails d1840419d1 docs: fixing copy inconsistencies in schematics description (#47453)
I fixed inconsistent spelling and formatting and replaced a dead link to clarity design system starter.

docs(schematics): revert a change in schematic usage pronoun

docs: parentheses removal from schematic generation description
Co-Authored-By: Bob Watson <104218420+bob-watson@users.noreply.github.com>

PR Close #47453
2022-10-24 10:41:48 +02:00
WD Snoeijer a014ca1760 docs: fix linter errors in user-input.md (#47832)
PR Close #47832
2022-10-21 19:14:01 +02:00
Balaji fb273f6461 docs: fix minor typo in hierarchical-dependency-injection.md (#47812)
Small Typo change 
- renamed oh to or in https://angular.io/guide/hierarchical-dependency-injection#skipself-and-viewproviders
PR Close #47812
2022-10-21 17:33:12 +02:00
Alex Castle 3a18398d83 fix(common): Don't warn about image distortion is fill mode is enabled (#47824)
The image distortion warning (when rendered aspect ratio is noticeably different than intrinsic) doesn't make sense with fill mode, where the user may want the image to stretch, crop or letterbox.

PR Close #47824
2022-10-20 16:50:02 -07:00
Dylan Hunn 44c1770fc9 release: cut the v15.0.0-rc.0 release 2022-10-19 23:53:31 +02:00
Andrew Scott 79e9e8ab77 fix(router): Delay router scroll event until navigated components have rendered (#47563)
Currently, the scroll event is fired immediately after the
`NavigationEnd`. However, this is problematic because a change detection
has not been able to run, meaning that Angular will not yet have run the update
block of the component templates being rendered as part of the navigation.

This change delays the scroll event using a `setTimeout`, which will
allow Angular's change detection to run before the scroll restoration is
performed.

fixes #24547

PR Close #47563
2022-10-19 23:11:18 +02:00
Andrew Kushnir 3d5df576d1 docs: exclude lifecycle hooks of the NgOptimizedImage from docs (#47814)
This commit adds the `@nodoc` annotations to the lifecycle hooks of the `NgOptimizedImage` directive to exclude them from the docs.

PR Close #47814
2022-10-19 23:08:53 +02:00
Andrew Kushnir 074b794c50 fix(docs-infra): display "developer preview" label on class members (#47814)
This commit adds the "developer preview" label for class properties and methods.

PR Close #47814
2022-10-19 23:08:52 +02:00
Alex Castle 4f52d4e474 fix(common): don't generate srcset if noopImageLoader is used (#47804)
Do not generate a srcset if the loader being used is the default noopImageLoader. This loader does not take width into account, so it does not make sense to use it with srcsets.

PR Close #47804
2022-10-19 23:08:02 +02:00
WD Snoeijer 716352c1b0 docs: fix linter errors for accessibility.md (#47725)
PR Close #47725
2022-10-19 20:13:54 +02:00
Andrew Kushnir 6e19a12f6d docs: declare NgOptimizedImage APIs as stable (#47794)
In v14.2, we've introduced a new directive to help developers to configure images for better performance. The directive was initially released in the "developer preview" mode. We've collected the feedback, made several improvements and we are happy to announce that the NgOptimizedImage APIs are promoted to stable!

This commit updates vast majority of APIs to drop the `@developerPreview` label, which effectively documents them as stable.

There are few APIs though that retained the `@developerPreview` annotations:
- the `IMAGE_CONFIG` token
- the `ImageConfig` type
- the `fill` @Input of the directive

We plan to collect some additional feedback for the mentioned APIs and drop the `@developerPreview` annotation after that.

PR Close #47794
2022-10-19 20:13:13 +02:00
urugator 5d3bae283c docs(router): fix misleading description of BaseRouteReuseStrategy (#47786)
The original description gave a false impression that only query params and fragment changes are ignored, while actually `routeParams` changes are ignored as well.
PR Close #47786
2022-10-19 20:12:24 +02:00
Virginia Dooley 6476f158aa docs: Linting suggested corrections made. Restructuring or rewording sentences to be shorter and clearer. (#47790)
PR Close #47790
2022-10-19 20:10:56 +02:00
Kara Erickson 420d6b3054 docs(common): update image directive docs (#47796)
This is a small commit to:
- clarify that loaders aren't mandatory
- remove outdated preconnect option from docs
- clarify how width/height should be set for fixed size images
- minor structural changes for clarity

PR Close #47796
2022-10-19 15:25:14 +02:00
Virginia Dooley c2c96639e2 docs: Linting suggested corrections made. Restructuring or rewording sentences to be shorter and clearer. Inserted an introductory paragraph under level 1 heading. (#47788)
PR Close #47788
2022-10-19 15:24:12 +02:00
Kara Erickson fa4798095e fix(common): update size error to mention 'fill' mode (#47797)
The current error that is thrown when the "width" or
"height" attributes is missing doesn't mention that
"fill" mode is another option. This commit updates
the error with that option.

PR Close #47797
2022-10-19 15:23:38 +02:00
Andrew Kushnir 6f1a4b8217 refactor(common): drop deprecated selector from the NgOptimizedImage directive (#47798)
This commit updates the NgOptimizedImage directive to:
- drop a deprecated selector (the `rawSrc` one)
- drop corresponding input getter

The `rawSrc` was replaced by the `ngSrc` one during the developer preview phase.

PR Close #47798
2022-10-19 15:23:04 +02:00
Kara Erickson 23f210c0ab fix(common): warn if using supported CDN but not built-in loader (#47330)
This commit adds a missing warning if the image directive
detects that you're hosting your image on one of our
supported image CDNs but you're not using the built-in loader
for it. This excludes applications that are using a custom
loader.

PR Close #47330
2022-10-19 15:21:52 +02:00
Andrew Kushnir a2f41703d1 docs: declare Standalone APIs as stable (#47754)
In v14, we've introduced core concepts to allow Components, Directives and Pipes to configure their dependencies
 without the need to use NgModules and without the need to be declared in an NgModule. The concepts and initial
set of APIs were marked as "developer preview" to allow developers to use these APIs and share the feedback.

Since v14, we've been reviewing the entire API surface of the framework and either updating existing APIs to support standalone or creating new APIs that allowed to use Router, HttpClient and other abstractions without NgMod
ules.

Based on the mentioned work to review and stabilize APIs and also based on the positive feedback from the commun
ity, we are happy to announce that the Standalone APIs are promoted to stable!

This commit updates vast majority of standalone-related APIs to drop the `@developerPreview` label, which effect
ively documents then as stable.

Two APIs that retained the `@developerPreview` annotations are:
- withRequestsMadeViaParent (from `@angular/common/http`)
- renderApplication (from `@angular/platform-server`)

We plan to collect some additional feedback for the mentioned APIs and drop the `@developerPreview` annotation b
efore the next major release.

Co-Authored-By: Alex Rickabaugh <alx@alxandria.net>
Co-Authored-By: Andrew Scott <atscott@google.com>
Co-Authored-By: Dylan Hunn <dylhunn@gmail.com>
Co-Authored-By: Jessica Janiuk <jessicajaniuk@google.com>
Co-Authored-By: JoostK <joost.koehoorn@gmail.com>
Co-Authored-By: Kristiyan Kostadinov <crisbeto@abv.bg>
Co-Authored-By: Pawel Kozlowski <pkozlowski.opensource@gmail.com>

PR Close #47754
2022-10-17 12:15:21 +02:00
WD Snoeijer 4d61d8900d docs: fix linter errors for zone.md (#47707)
PR Close #47707
2022-10-17 12:14:45 +02:00
WD Snoeijer cf17a8096d docs: fix linter errors for web-worker.md (#47766)
PR Close #47766
2022-10-17 12:13:41 +02:00
Kristiyan Kostadinov 309b2cde51 fix(compiler-cli): implement more host directive validations as diagnostics (#47768)
Implements more of the runtime validations for host directives as compiler diagnostics so that they can be caught earlier. Also does some minor cleanup.

PR Close #47768
2022-10-17 12:12:22 +02:00
WD Snoeijer d366664007 docs: fix linter errors for view-encapsulation.md (#47772)
PR Close #47772
2022-10-17 12:11:54 +02:00
Paul Gschwendtner b9553882b8 test: update size golden for main bundle reduction (#47717)
The `main` bundle size has been reduced with the Angular CLI update.
This is not worth investigating as it's a positive side reduction likely
due to further optimizations in the Angular CLI devkit.

Also updates the other golden payload entries to capture all other CLI
related payload changes- making future payload update easier to
investigate.

PR Close #47717
2022-10-17 12:11:26 +02:00
Paul Gschwendtner 334a740ec0 build: run ng update for Angular CLI next (#47717)
Runs the Angular CLI v15 migrations for AIO.

PR Close #47717
2022-10-17 12:11:26 +02:00
Paul Gschwendtner 0a87176b74 build: update cross angular deps and lock dependencies (#47717)
Renovate no longer updated the dependencies because they were expanded
to a range. Ranges did not satisfy the `@next` tag anymore- so Renovate
did was not able to update.

This fixes the dependencies by locking them- and also updates the
versions according to our Renovate config.

PR Close #47717
2022-10-17 12:11:26 +02:00
Alan Agius b6fd814542 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
Charles Barnes 4c95484c0a docs(docs-infra): fix errors page hover styles (#47770)
fix hover styles for error messages to be consistent for dark theme

Fixes #47723

PR Close #47770
2022-10-17 09:57:47 +02:00
Paul Gschwendtner b6e9a50d22 build: update ng-dev to fix caretaker check and update label config (#47779)
* Updates ng-dev to support the new g3sync canonical JSON configs
* Updates the google-internal-tests option to support the g3 sync
  canonical JSON config
* Moves the YAML sync config to a dedicated JSON file, used by the
  action and by `yarn ng-dev`.
* Updates the ng-dev caretaker config to fix that the Merge assistance
  queue is always empty.

PR Close #47779
2022-10-17 09:57:17 +02:00
Charles Lyding 874f3fc4d3 refactor(compiler-cli): use mkdirSync recursive option instead of custom implementation (#47678)
The supported Node.js versions for the `@angular/compiler-cli` package (^14.15.0 || >=16.10.0)
allow for the use of the `recursive` option of `mkdirSync`.  Using the `recursive` option
removes the need to manually create each subdirectory in a given path.

PR Close #47678
2022-10-13 13:51:04 -07:00
abergquist 0457b58dfe docs: Separated HTML elements with blank lines (#47331)
Separated HTML elements with judicious use of space. It not only makes it easier to read the HTML; it also makes it consistent with the formatting of https://github.com/angular/angular/edit/main/aio/content/examples/what-is-angular/src/app/hello-world-bindings/hello-world-ngif.component.html.

PR Close #47331
2022-10-13 19:10:28 +00:00
Andrew Kushnir e13d97cf7e refactor(common): make provideHttpClient return EnvironmentProviders (#47758)
This commit updates the `provideHttpClient` function to return the `EnvironmentProviders` instead of a regular `Provider[]`, to make sure that the `provideHttpClient` can only be used where an environment is being setup.

PR Close #47758
2022-10-13 16:44:59 +00:00
Bob Watson 955edf2afd docs: update of documentation contrib. guide (#47381)
This update describes the content authoring and revision process in sufficient detail for technical and non-technical contributors to the angular.io documentation.

PR Close #47381
2022-10-13 16:37:26 +00:00
Paul Gschwendtner 1b48e65e89 build: wire up new github action for identifying g3-affecting PRs (#47735)
Wire up new github action for identifying g3-affecting PRs.

PR Close #47735
2022-10-13 09:43:43 +00:00
Jessica Janiuk 93cc5b2210 release: cut the v15.0.0-next.6 release 2022-10-12 11:38:19 -07:00
367 changed files with 9784 additions and 7563 deletions
+2 -58
View File
@@ -22,7 +22,7 @@ merge:
# the g3 status will be added to your pull requests if they include files that match the patterns
g3Status:
# set to true to disable
disabled: false
disabled: true
# the name of the status
context: 'google3'
# text to show when the status is pending, {{PRNumber}} will be replaced by the PR number
@@ -32,64 +32,8 @@ merge:
# link to use for the details
url: 'http://go/angular/g3sync'
# list of patterns to check for the files changed by the PR
# this list must be manually kept in sync with google3/third_party/javascript/angular2/copy.bara.sky
include:
- 'LICENSE'
- 'modules/benchmarks/**'
- 'modules/system.d.ts'
- 'packages/**'
# list of patterns to ignore for the files changed by the PR
exclude:
- 'packages/*'
- 'packages/bazel/*'
- 'packages/bazel/src/*'
- 'packages/bazel/src/api-extractor/**'
- 'packages/bazel/src/builders/**'
- 'packages/bazel/src/ng_module/**'
- 'packages/bazel/src/ng_package/**'
- 'packages/bazel/src/protractor/**'
- 'packages/bazel/src/schematics/**'
- 'packages/bazel/src/types_bundle/**'
- 'packages/compiler-cli/src/ngcc/**'
- 'packages/compiler-cli/linker/**'
- 'packages/compiler-cli/ngcc/**'
- 'packages/compiler-cli/src/ngtsc/sourcemaps/**'
# 'private' mostly contains entrypoints for 3P Angular.
# Note that 'private/migrations' _is_ used.
- 'packages/compiler-cli/private/bazel.ts'
- 'packages/compiler-cli/private/localize.ts'
- 'packages/compiler-cli/private/tooling.ts'
- 'packages/compiler-cli/private/babel.d.ts'
# google3 defines its own binary entrypoints.
- 'packages/compiler-cli/src/bin/**'
- 'packages/docs/**'
- 'packages/elements/schematics/**'
- 'packages/examples/**'
- 'packages/language-service/**'
- 'packages/localize/**'
- 'packages/private/**'
- 'packages/service-worker/**'
- 'packages/common/locales/generate-locales-tool/**'
- 'packages/common/locales/index.bzl'
- 'packages/http/**'
- '**/.gitignore'
- '**/.gitkeep'
- '**/yarn.lock'
- '**/package.json'
- '**/third_party/**'
- '**/tsconfig-build.json'
- '**/tsconfig-tsec.json'
- '**/tsconfig.json'
- '**/rollup.config.js'
- '**/BUILD.bazel'
- '**/*.md'
- 'packages/**/integrationtest/**'
- 'packages/**/test/**'
- 'packages/zone.js/*'
- 'packages/zone.js/dist/**'
- 'packages/zone.js/doc/**'
- 'packages/zone.js/example/**'
- 'packages/zone.js/scripts/**'
# comment that will be added to a PR when there is a conflict, leave empty or set to false to disable
mergeConflictComment: "Hi @{{PRAuthor}}! This PR has merge conflicts due to recent upstream merges.\nPlease help to unblock it by resolving these conflicts. Thanks!"
@@ -127,7 +71,7 @@ merge:
- 'ci/circleci: build'
- 'ci/circleci: lint'
- 'ci/angular: size'
- 'google3'
- 'google-internal-tests'
- 'pullapprove'
# the comment that will be added when the merge label is added despite failing checks, leave empty or set to false to disable
+2 -2
View File
@@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
- uses: angular/dev-infra/github-actions/commit-message-based-labels@c9b2ff083a50d0eac742da1e69e0cbdb98bf53dd
- uses: angular/dev-infra/github-actions/commit-message-based-labels@d87b1b56a970132f90301624cea6b6d70b6d9489
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
post_approval_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
- uses: angular/dev-infra/github-actions/post-approval-changes@c9b2ff083a50d0eac742da1e69e0cbdb98bf53dd
- uses: angular/dev-infra/github-actions/post-approval-changes@d87b1b56a970132f90301624cea6b6d70b6d9489
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+1 -1
View File
@@ -14,6 +14,6 @@ jobs:
if: github.repository == 'angular/angular'
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/feature-request@a64f3515ea822a8b228ebaab1c52e76e557a580c
- uses: angular/dev-infra/github-actions/feature-request@d87b1b56a970132f90301624cea6b6d70b6d9489
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
@@ -0,0 +1,20 @@
name: Google Internal Tests Enforcement
on:
pull_request_target:
types: [opened, reopened, synchronize]
permissions:
pull-requests: read
statuses: write
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
- uses: angular/dev-infra/github-actions/google-internal-tests@d87b1b56a970132f90301624cea6b6d70b6d9489
with:
run-tests-guide-url: http://go/angular/g3sync
github-token: ${{ secrets.GITHUB_TOKEN }}
sync-config: ./.ng-dev/google-sync-config.json
+1 -1
View File
@@ -14,6 +14,6 @@ jobs:
if: github.repository == 'angular/angular'
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/lock-closed@c9b2ff083a50d0eac742da1e69e0cbdb98bf53dd
- uses: angular/dev-infra/github-actions/lock-closed@d87b1b56a970132f90301624cea6b6d70b6d9489
with:
lock-bot-key: ${{ secrets.LOCK_BOT_PRIVATE_KEY }}
+1 -1
View File
@@ -35,7 +35,7 @@ jobs:
- name: Generate `events.json`
run: node aio/scripts/generate-events/index.mjs --ignore-invalid-dates
- name: Create a PR (if necessary)
uses: angular/dev-infra/github-actions/create-pr-for-changes@c9b2ff083a50d0eac742da1e69e0cbdb98bf53dd
uses: angular/dev-infra/github-actions/create-pr-for-changes@d87b1b56a970132f90301624cea6b6d70b6d9489
with:
branch-prefix: docs-update-events
pr-title: 'docs: update events'
+2 -1
View File
@@ -2,6 +2,7 @@ import {CaretakerConfig} from '@angular/ng-dev';
/** The configuration for `ng-dev caretaker` commands. */
export const caretaker: CaretakerConfig = {
g3SyncConfigPath: './.ng-dev/google-sync-config.json',
githubQueries: [
{
name: 'Merge Queue',
@@ -9,7 +10,7 @@ export const caretaker: CaretakerConfig = {
},
{
name: 'Merge Assistance Queue',
query: `is:pr is:open label:"action: merge-assistance"`,
query: `is:pr is:open label:"merge: caretaker note" label:"action: merge"`,
},
{
name: 'Initial Triage Queue',
+52
View File
@@ -0,0 +1,52 @@
{
"syncedFilePatterns": ["LICENSE", "modules/benchmarks/**", "modules/system.d.ts", "packages/**"],
"alwaysExternalFilePatterns": [
"packages/*",
"packages/bazel/*",
"packages/bazel/src/*",
"packages/bazel/src/api-extractor/**",
"packages/bazel/src/builders/**",
"packages/bazel/src/ng_module/**",
"packages/bazel/src/ng_package/**",
"packages/bazel/src/protractor/**",
"packages/bazel/src/schematics/**",
"packages/bazel/src/types_bundle/**",
"packages/compiler-cli/src/ngcc/**",
"packages/compiler-cli/linker/**",
"packages/compiler-cli/ngcc/**",
"packages/compiler-cli/src/ngtsc/sourcemaps/**",
"packages/compiler-cli/private/bazel.ts",
"packages/compiler-cli/private/localize.ts",
"packages/compiler-cli/private/tooling.ts",
"packages/compiler-cli/private/babel.d.ts",
"packages/compiler-cli/src/bin/**",
"packages/docs/**",
"packages/elements/schematics/**",
"packages/examples/**",
"packages/language-service/**",
"packages/localize/**",
"packages/private/**",
"packages/service-worker/**",
"packages/common/locales/generate-locales-tool/**",
"packages/common/locales/index.bzl",
"packages/http/**",
"**/.gitignore",
"**/.gitkeep",
"**/yarn.lock",
"**/package.json",
"**/third_party/**",
"**/tsconfig-build.json",
"**/tsconfig-tsec.json",
"**/tsconfig.json",
"**/rollup.config.js",
"**/BUILD.bazel",
"**/*.md",
"packages/**/integrationtest/**",
"packages/**/test/**",
"packages/zone.js/*",
"packages/zone.js/dist/**",
"packages/zone.js/doc/**",
"packages/zone.js/example/**",
"packages/zone.js/scripts/**"
]
}
-3
View File
@@ -6,9 +6,6 @@ import {PullRequestConfig} from '@angular/ng-dev';
*/
export const pullRequest: PullRequestConfig = {
githubApiMerge: false,
mergeReadyLabel: 'action: merge',
caretakerNoteLabel: 'action: caretaker note',
commitMessageFixupLabel: 'merge: fix commit message',
requiredBaseCommits: {
// PRs that target either `main` or the patch branch, need to be rebased
// on top of the latest commit message validation fix.
+25 -3
View File
@@ -61,9 +61,8 @@
version: 3
availability:
users_unavailable:
- atscott
# availability:
# users_unavailable:
# Meta field that goes unused by PullApprove to allow for defining aliases to be
# used throughout the config.
@@ -326,6 +325,7 @@ groups:
'aio/content/guide/two-way-binding.md',
'aio/content/examples/two-way-binding/**/{*,.*}',
'aio/content/guide/built-in-directives.md',
'aio/content/guide/directive-composition-api.md',
'aio/content/examples/built-in-directives/**/{*,.*}',
'aio/content/images/guide/built-in-directives/**/{*,.*}',
'aio/content/guide/template-reference-variables.md',
@@ -1083,6 +1083,28 @@ groups:
'aio/content/guide/reviewing-content.md',
'aio/content/guide/updating-content-github-ui.md',
'aio/content/guide/updating-search-keywords.md',
'aio/content/guide/doc-build-test.md',
'aio/content/guide/doc-edit-finish.md',
'aio/content/guide/doc-editing.md',
'aio/content/guide/doc-github-tasks.md',
'aio/content/guide/doc-pr-open.md',
'aio/content/guide/doc-pr-prep.md',
'aio/content/guide/doc-pr-update.md',
'aio/content/guide/doc-prepare-to-edit.md',
'aio/content/guide/doc-select-issue.md',
'aio/content/guide/doc-tasks.md',
'aio/content/guide/doc-update-overview.md',
'aio/content/guide/doc-update-start.md',
'aio/content/guide/docs-lint-errors.md',
'aio/content/images/guide/preparing-to-edit-docs/**/{*,.*}',
'aio/content/images/guide/github-for-docs/**/{*,.*}',
'aio/content/images/guide/doc-update-start/**/{*,.*}',
'aio/content/images/guide/doc-update-overview/**/{*,.*}',
'aio/content/images/guide/doc-pr-update/**/{*,.*}',
'aio/content/images/guide/doc-pr-prep/**/{*,.*}',
'aio/content/images/guide/doc-pr-open/**/{*,.*}',
'aio/content/images/guide/doc-github-tasks/**/{*,.*}',
'aio/content/images/guide/doc-prepare-to-edit/**/{*,.*}',
])
reviewers:
users:
+9 -21
View File
@@ -16,7 +16,7 @@
"remoteRoot": "${workspaceRoot}",
"stopOnEntry": false,
"timeout": 600000,
"outFiles": ["${workspaceFolder}/bazel-out/**/angular/**/*.js"],
"outFiles": ["${workspaceFolder}/dist/out/**/packages/**/*.js"]
},
{
"name": "Attach to bazel test ... --config=debug (no source maps)",
@@ -30,58 +30,46 @@
"remoteRoot": "${workspaceRoot}",
"stopOnEntry": false,
"timeout": 600000,
"outFiles": ["${workspaceFolder}/bazel-out/**/angular/**/*.js"],
"outFiles": ["${workspaceFolder}/dist/out/**/packages/**/*.js"]
},
{
"name": "IVY:packages/core/test/acceptance",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/bazelisk",
"args": [
"test",
"packages/core/test/acceptance",
"--config=debug"
],
"args": ["test", "packages/core/test/acceptance", "--config=debug"],
"port": 9229,
"address": "localhost",
"restart": true,
"sourceMaps": true,
"timeout": 600000,
"outFiles": ["${workspaceFolder}/bazel-out/**/angular/**/*.js"],
"outFiles": ["${workspaceFolder}/dist/out/**/packages/**/*.js"]
},
{
"name": "IVY:packages/core/test/render3",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/bazelisk",
"args": [
"test",
"packages/core/test/render3",
"--config=debug"
],
"args": ["test", "packages/core/test/render3", "--config=debug"],
"port": 9229,
"address": "localhost",
"restart": true,
"sourceMaps": true,
"timeout": 600000,
"outFiles": ["${workspaceFolder}/bazel-out/**/angular/**/*.js"],
"outFiles": ["${workspaceFolder}/dist/out/**/packages/**/*.js"]
},
{
"name": "IVY:packages/core/test",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/bazelisk",
"args": [
"test",
"packages/core/test",
"--config=debug"
],
"args": ["test", "packages/core/test", "--config=debug"],
"port": 9229,
"address": "localhost",
"restart": true,
"sourceMaps": true,
"timeout": 600000,
"outFiles": ["${workspaceFolder}/bazel-out/**/angular/**/*.js"],
},
"outFiles": ["${workspaceFolder}/dist/out/**/packages/**/*.js"]
}
]
}
+124 -127
View File
@@ -1,17 +1,5 @@
<a name="14.2.6"></a>
# 14.2.6 (2022-10-12)
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [3fd176a905](https://github.com/angular/angular/commit/3fd176a9054bea6f6c4cd22e8ff3b8f63b86b637) | fix | add missing period to error message ([#47744](https://github.com/angular/angular/pull/47744)) |
| [c3821f5ab5](https://github.com/angular/angular/commit/c3821f5ab5bf54b2c9d7868da79a742d4e4b7667) | perf | minimize filesystem calls when generating shims ([#47682](https://github.com/angular/angular/pull/47682)) |
## Special Thanks
Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, Charles Lyding, Joey Perrott, Joshua Morony, Mathew Berg, Paul Gschwendtner, Peter Dickten, Renan Ferro, Sri Ram, WD Snoeijer, markostanimirovic and Álvaro Martínez
<!-- CHANGELOG SPLIT MARKER -->
<a name="15.0.0-next.5"></a>
# 15.0.0-next.5 (2022-10-05)
<a name="15.0.0"></a>
# 15.0.0 (2022-11-16)
## Breaking Changes
### compiler
- Keyframes names are now prefixed with the component's "scope name".
@@ -31,6 +19,32 @@ Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, Charl
- change the component's view encapsulation to the `None` or `ShadowDom`
- define keyframes rules in global stylesheets (e.g styles.css)
- define keyframes rules programmatically in code.
### compiler-cli
- Invalid constructors for DI may now report compilation errors
When a class inherits its constructor from a base class, the compiler may now
report an error when that constructor cannot be used for DI purposes. This may
either be because the base class is missing an Angular decorator such as
`@Injectable()` or `@Directive()`, or because the constructor contains parameters
which do not have an associated token (such as primitive types like `string`).
These situations used to behave unexpectedly at runtime, where the class may be
constructed without any of its constructor parameters, so this is now reported
as an error during compilation.
Any new errors that may be reported because of this change can be resolved either
by decorating the base class from which the constructor is inherited, or by adding
an explicit constructor to the class for which the error is reported.
- Angular compiler option `enableIvy` has been removed as Ivy is the only rendering engine.
### core
- Angular no longer supports Node.js versions `14.[15-19].x` and `16.[10-12].x`. Current supported versions of Node.js are `14.20.x`, `16.13.x` and `18.10.x`.
- TypeScript versions older than 4.8 are no longer supported.
- Existing iframe usages may have security-sensitive attributes applied as an attribute or property binding in a template or via host bindings in a directive. Such usages would require an update to ensure compliance with the new stricter rules around iframe bindings.
- Existing iframe usages may have `src` or `srcdoc` preceding other attributes. Such usages may need to be updated to ensure compliance with the new stricter rules around iframe bindings.
### forms
- setDisabledState will always be called when a `ControlValueAccessor` is attached. You can opt-out with `FormsModule.withConfig` or `ReactiveFormsModule.withConfig`.
### localize
- - `canParse` method has been removed from all translation parsers in `@angular/localize/tools`. `analyze` should be used instead.
- the `hint` parameter in the`parse` methods is now mandatory.
### router
- Previously, the `RouterOutlet` would immediately
instantiate the component being activated during navigation. Now the
@@ -38,7 +52,15 @@ Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, Charl
could affect tests which do not trigger change detection after a router
navigation. In rarer cases, this can affect production code that relies
on the exact timing of component availability.
- The title property is now required on ActivatedRouteSnapshot
- `relativeLinkResolution` is no longer configurable in
the Router. This option was used as a means to opt out of a bug fix.
## Deprecations
### common
- The `DATE_PIPE_DEFAULT_TIMEZONE` token is now deprecated in favor
of the `DATE_PIPE_DEFAULT_OPTIONS` token, which accepts an object
as a value and the timezone can be defined as a field (called `timezone`)
on that object.
### core
- - The ability to pass an `NgModule` to the `providedIn` option for
`@Injectable` and `InjectionToken` is now deprecated.
@@ -54,29 +76,116 @@ Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, Charl
`providedIn: 'any'` is an option with confusing semantics and is almost
never used apart from a handful of esoteric cases internal to the framework.
- The bit field signature of `Injector.get()` has been deprecated, in favor of the new options object.
- The bit field signature of `TestBed.inject()` has been deprecated, in favor of the new options object.
### router
- The `RouterLinkWithHref` directive is deprecated, use the `RouterLink` directive instead. The `RouterLink` contains the code from the `RouterLinkWithHref` to handle elements with `href` attributes.
### common
| Commit | Type | Description |
| -- | -- | -- |
| [c0c7efaf7c](https://github.com/angular/angular/commit/c0c7efaf7c8a53c1a6f137aac960757cc804f263) | feat | add `provideLocationMocks()` function to provide Location mocks ([#47674](https://github.com/angular/angular/pull/47674)) |
| [75e6297f09](https://github.com/angular/angular/commit/75e6297f0901cc98aea1626a138a820e68d026ec) | feat | add <link> preload tag on server for priority img ([#47343](https://github.com/angular/angular/pull/47343)) |
| [4fde292bb5](https://github.com/angular/angular/commit/4fde292bb58f5d5bc3cf6e634f7cff9eb0d13d84) | feat | Add automatic srcset generation to ngOptimizedImage ([#47547](https://github.com/angular/angular/pull/47547)) |
| [9483343ebf](https://github.com/angular/angular/commit/9483343ebf958297ebcb81ef313d356296a41f41) | feat | Add fill mode to NgOptimizedImage ([#47738](https://github.com/angular/angular/pull/47738)) |
| [bdb5371033](https://github.com/angular/angular/commit/bdb5371033d8e9a110619861323e8383a32d5900) | feat | add injection token for default DatePipe configuration ([#47157](https://github.com/angular/angular/pull/47157)) |
| [449d29b701](https://github.com/angular/angular/commit/449d29b701ee5a50e7279d44f4c3888a5d6f7e96) | fix | Add fetchpriority to ngOptimizedImage preloads ([#48010](https://github.com/angular/angular/pull/48010)) |
| [4f52d4e474](https://github.com/angular/angular/commit/4f52d4e47416494b4054e43a0d96383bde7813ca) | fix | don't generate srcset if noopImageLoader is used ([#47804](https://github.com/angular/angular/pull/47804)) |
| [3a18398d83](https://github.com/angular/angular/commit/3a18398d8303fb4ae1923b3a182e6abb92e3117b) | fix | Don't warn about image distortion is fill mode is enabled ([#47824](https://github.com/angular/angular/pull/47824)) |
| [edea15f2c6](https://github.com/angular/angular/commit/edea15f2c63675e86248a25649008a10e1384334) | fix | export the IMAGE_CONFIG token ([#48051](https://github.com/angular/angular/pull/48051)) |
| [8abf1c844c](https://github.com/angular/angular/commit/8abf1c844c656b41a604098889db76e8c63da720) | fix | fix formatting on oversized image error ([#47188](https://github.com/angular/angular/pull/47188)) |
| [ca7bf65933](https://github.com/angular/angular/commit/ca7bf6593380fa760891d29fba5c9f61c6e9bf8b) | fix | rename `rawSrc` -> `ngSrc` in NgOptimizedImage directive ([#47362](https://github.com/angular/angular/pull/47362)) |
| [b3879dbf14](https://github.com/angular/angular/commit/b3879dbf1470ab4f31e676f1f8909cd50d963844) | fix | support density descriptors with 2+ decimals ([#47197](https://github.com/angular/angular/pull/47197)) |
| [fa4798095e](https://github.com/angular/angular/commit/fa4798095e3820087c4a3bccc9638c5e979315da) | fix | update size error to mention 'fill' mode ([#47797](https://github.com/angular/angular/pull/47797)) |
| [23f210c0ab](https://github.com/angular/angular/commit/23f210c0abfb6104f4aa2f39d0efd096c2b7574d) | fix | warn if using supported CDN but not built-in loader ([#47330](https://github.com/angular/angular/pull/47330)) |
| [945432e3fa](https://github.com/angular/angular/commit/945432e3fa2cb22ff911eda2a8ad3302a8adba5a) | fix | Warn on fill ngOptimizedImage without height ([#48036](https://github.com/angular/angular/pull/48036)) |
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [051f75648d](https://github.com/angular/angular/commit/051f75648d6065949796ac1c7ea67e71e31b011e) | fix | scope css keyframes in emulated view encapsulation ([#42608](https://github.com/angular/angular/pull/42608)) |
| [39b72e208b](https://github.com/angular/angular/commit/39b72e208b46d80f1d9a802cebf043c2ccf3c5f2) | fix | update element schema ([#47552](https://github.com/angular/angular/pull/47552)) |
| [48b354a83e](https://github.com/angular/angular/commit/48b354a83e6d94735a03eebb3a52c5698e7a0f44) | fix | update element schema ([#47552](https://github.com/angular/angular/pull/47552)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [bc54687c7b](https://github.com/angular/angular/commit/bc54687c7b91efe451aa744d2d3a15ca3524231e) | fix | exclude abstract classes from `strictInjectionParameters` requirement ([#44615](https://github.com/angular/angular/pull/44615)) |
| [309b2cde51](https://github.com/angular/angular/commit/309b2cde51d1577d6561e826be01e2b5fce43c49) | fix | implement more host directive validations as diagnostics ([#47768](https://github.com/angular/angular/pull/47768)) |
| [2e1dddec45](https://github.com/angular/angular/commit/2e1dddec45fef8291b1f3abce2a937e28bb75a87) | fix | support hasInvalidatedResolutions. ([#47585](https://github.com/angular/angular/pull/47585)) |
| [19ad4987f9](https://github.com/angular/angular/commit/19ad4987f9070222bb2fb8bd07a43ed7995f602a) | fix | use @ts-ignore. ([#47636](https://github.com/angular/angular/pull/47636)) |
| [8fcadaad48](https://github.com/angular/angular/commit/8fcadaad48b2b1328f47b7603b230445a26f95a8) | perf | cache source file for reporting type-checking diagnostics ([#47471](https://github.com/angular/angular/pull/47471)) |
| [16f96eeabf](https://github.com/angular/angular/commit/16f96eeabf77964092b4b6a830e29f2761ffaeec) | refactor | remove `enableIvy` options ([#47346](https://github.com/angular/angular/pull/47346)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [e3cef4a784](https://github.com/angular/angular/commit/e3cef4a7843d22fd004f1e27afcc42d0fbbef74a) | docs | deprecate `providedIn: NgModule` and `providedIn: 'any'` ([#47616](https://github.com/angular/angular/pull/47616)) |
| [1b9fd46d14](https://github.com/angular/angular/commit/1b9fd46d14ed46f78b6d761b3917ded1f0d51e0d) | feat | add support for Node.js version 18 ([#47730](https://github.com/angular/angular/pull/47730)) |
| [ed11a13c3c](https://github.com/angular/angular/commit/ed11a13c3c5cccb0094c1a4ff9c60ea741a42067) | feat | drop support for TypeScript 4.6 and 4.7 ([#47690](https://github.com/angular/angular/pull/47690)) |
| [db28badfe6](https://github.com/angular/angular/commit/db28badfe67f404e81dacd7c3131af105feb3412) | feat | enable the new directive composition API ([#47642](https://github.com/angular/angular/pull/47642)) |
| [7de1469be6](https://github.com/angular/angular/commit/7de1469be62b08037681ee9e75614fb800700ef8) | feat | introduce EnvironmentProviders wrapper type ([#47669](https://github.com/angular/angular/pull/47669)) |
| [841c8e5138](https://github.com/angular/angular/commit/841c8e51386645d7fd26642f41952ed8f0a2dbe5) | feat | support object-based DI flags in Injector.get() ([#46761](https://github.com/angular/angular/pull/46761)) |
| [120555a626](https://github.com/angular/angular/commit/120555a626d66523e46ce01681b11a0f38e3a40a) | feat | support object-based DI flags in TestBed.inject() ([#46761](https://github.com/angular/angular/pull/46761)) |
| [96c0e42e61](https://github.com/angular/angular/commit/96c0e42e61b8a4fced1354da0162c06e7b029cf3) | fix | allow readonly arrays for standalone imports ([#47851](https://github.com/angular/angular/pull/47851)) |
| [28f289b825](https://github.com/angular/angular/commit/28f289b825be7f4bf6dc5db69197741867b8ea23) | fix | hardening attribute and property binding rules for <iframe> elements ([#47964](https://github.com/angular/angular/pull/47964)) |
| [d4b3c0b47c](https://github.com/angular/angular/commit/d4b3c0b47c32a9a664d3073164d04c0385058008) | fix | hardening rules related to the attribute order on iframe elements ([#47935](https://github.com/angular/angular/pull/47935)) |
| [85330f3fd9](https://github.com/angular/angular/commit/85330f3fd9ac6381ce3aa18479ed8195d2ac215e) | fix | update `isDevMode` to rely on `ngDevMode` ([#47475](https://github.com/angular/angular/pull/47475)) |
### forms
| Commit | Type | Description |
| -- | -- | -- |
| [a8569e3802](https://github.com/angular/angular/commit/a8569e38029724a7d77935bccce99117a7e1aefa) | feat | export forms utility functions: isFormArray, isFormGroup… ([#47718](https://github.com/angular/angular/pull/47718)) |
| [96b7fe93af](https://github.com/angular/angular/commit/96b7fe93af361a1cf2ea5477970f64ba6f3d8cd5) | fix | call `setDisabledState` on `ControlValueAcessor` when control is enabled ([#47576](https://github.com/angular/angular/pull/47576)) |
| [a99d9d67f3](https://github.com/angular/angular/commit/a99d9d67f382c18b46c4c1c6765bbda445ca0b8c) | fix | don't mutate validators array ([#47830](https://github.com/angular/angular/pull/47830)) |
| [2625dc1312](https://github.com/angular/angular/commit/2625dc13127da9f8d5fa79f1b32ad132d6656c63) | fix | Improve a very commonly viewed error message by adding a guide. ([#47969](https://github.com/angular/angular/pull/47969)) |
| [ae29f98c20](https://github.com/angular/angular/commit/ae29f98c20390abbf84d2df312ee5e8766195d60) | fix | Runtime error pages must begin with leading zero ([#47991](https://github.com/angular/angular/pull/47991)) |
### http
| Commit | Type | Description |
| -- | -- | -- |
| [3ba99e286a](https://github.com/angular/angular/commit/3ba99e286a166d122fb334171b6a9a1e6461a724) | feat | allow for child `HttpClient`s to request via parents ([#47502](https://github.com/angular/angular/pull/47502)) |
| [84d0d33c35](https://github.com/angular/angular/commit/84d0d33c3537f0da927e0ce449ede78ef9bebc6b) | feat | introduce `provideHttpClientTesting` provider function ([#47502](https://github.com/angular/angular/pull/47502)) |
| [62c7a7a16e](https://github.com/angular/angular/commit/62c7a7a16e035c3a5346270dc4c5c6de85bf9137) | feat | introduce functional interceptors ([#47502](https://github.com/angular/angular/pull/47502)) |
| [e47b129070](https://github.com/angular/angular/commit/e47b129070655f2e9eeac58bc2d0ea5648f41045) | feat | introduce the `provideHttpClient()` API ([#47502](https://github.com/angular/angular/pull/47502)) |
| [ea16a98dfe](https://github.com/angular/angular/commit/ea16a98dfef0de33c192e328f151cca39749a488) | fix | better handle unexpected `undefined` XSRF tokens ([#47683](https://github.com/angular/angular/pull/47683)) |
| [e7b48da713](https://github.com/angular/angular/commit/e7b48da713f32c02c096f1342ab8b0d7ec696ca5) | fix | rename `withLegacyInterceptors` to `withInterceptorsFromDi` ([#47901](https://github.com/angular/angular/pull/47901)) |
### language-service
| Commit | Type | Description |
| -- | -- | -- |
| [bebef5fb43](https://github.com/angular/angular/commit/bebef5fb43dcf54a109499d0d9dd701786c33f60) | feat | Quick fix to import a component when its selector is used ([#47088](https://github.com/angular/angular/pull/47088)) |
| [e7ee53c541](https://github.com/angular/angular/commit/e7ee53c541da0a1f85c217354ec9901010ae0de9) | feat | support to fix invalid banana in box ([#47393](https://github.com/angular/angular/pull/47393)) |
### localize
| Commit | Type | Description |
| -- | -- | -- |
| [400a6b5e37](https://github.com/angular/angular/commit/400a6b5e3707f3939d84c659a115b75ef15d2c09) | fix | add polyfill in polyfills array instead of polyfills.ts ([#47569](https://github.com/angular/angular/pull/47569)) |
| [b6fd814542](https://github.com/angular/angular/commit/b6fd81454207bd256a48d5726f3bd7e6ce6a489b) | fix | update ng add schematic to support Angular CLI version 15 ([#47763](https://github.com/angular/angular/pull/47763)) |
| [d36fd3d9e4](https://github.com/angular/angular/commit/d36fd3d9e41984818af5e1aad5e3004574d837bb) | refactor | remove deprecated `canParse` method from TranslationParsers ([#47275](https://github.com/angular/angular/pull/47275)) |
### platform-server
| Commit | Type | Description |
| -- | -- | -- |
| [2908eba59c](https://github.com/angular/angular/commit/2908eba59c25e9a1fc5aa257b4a8a247db82079e) | fix | align server renderer interface with base renderer ([#47868](https://github.com/angular/angular/pull/47868)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [7bee28d037](https://github.com/angular/angular/commit/7bee28d037a8a21a7440293b3e8c118cc93ec8c1) | feat | add a migration to remove `relativeLinkResolution` usages ([#47604](https://github.com/angular/angular/pull/47604)) |
| [5163e3d876](https://github.com/angular/angular/commit/5163e3d876cdfd6d309d7e35aefa6f07ef62715e) | feat | Add UrlTree constructor to public API ([#47186](https://github.com/angular/angular/pull/47186)) |
| [da58801f95](https://github.com/angular/angular/commit/da58801f95c66c201e332189af25702bdd722f3f) | feat | auto-unwrap default exports when lazy loading ([#47586](https://github.com/angular/angular/pull/47586)) |
| [c3f857975d](https://github.com/angular/angular/commit/c3f857975d56cac6ad3939d64f76a51455159c23) | feat | make RouterOutlet name an Input so it can be set dynamically ([#46569](https://github.com/angular/angular/pull/46569)) |
| [f73ef21442](https://github.com/angular/angular/commit/f73ef2144279b6b26902510f90ca1fccb8e166b2) | feat | merge `RouterLinkWithHref` into `RouterLink` ([#47630](https://github.com/angular/angular/pull/47630)) |
| [16c8f55663](https://github.com/angular/angular/commit/16c8f55663c30270fcd647b1a8a20ddbc8923349) | feat | migrate `RouterLinkWithHref` references to `RouterLink` ([#47599](https://github.com/angular/angular/pull/47599)) |
| [07017a7bd3](https://github.com/angular/angular/commit/07017a7bd30c6bb7bd1b94a9fd1b112ee68c9ced) | feat | prevent `provideRouter()` from usage in @Component ([#47669](https://github.com/angular/angular/pull/47669)) |
| [79e9e8ab77](https://github.com/angular/angular/commit/79e9e8ab779d230f6a1df25c4ccff94b13129305) | fix | Delay router scroll event until navigated components have rendered ([#47563](https://github.com/angular/angular/pull/47563)) |
| [6a88bad019](https://github.com/angular/angular/commit/6a88bad0192516f26a5a008c0634b73456b9447c) | fix | Ensure ActivatedRouteSnapshot#title has correct value ([#47481](https://github.com/angular/angular/pull/47481)) |
| [7b89d95c0e](https://github.com/angular/angular/commit/7b89d95c0e7370d33f006aba8e67bafb53a2fd4f) | fix | Remove deprecated relativeLinkResolution ([#47623](https://github.com/angular/angular/pull/47623)) |
## Special Thanks
Alan Agius, Alex Rickabaugh, Alexander Wiebe, Andrew Kushnir, Andrew Scott, Ciprian Sauliuc, Dmytro Mezhenskyi, Dylan Hunn, George Kalpakas, Joe Martin (Crowdstaffing), Jordan, Kristiyan Kostadinov, Martin Probst, Ole M, Paul Gschwendtner, Pawel Kozlowski, dario-piotrowicz and mgechev
Alan Agius, AleksanderBodurri, Alex Castle, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Charles Lyding, Dylan Hunn, Ferdinand Malcher, George Kalpakas, Jeremy Elbourn, Jessica Janiuk, JiaLiPassion, Joey Perrott, JoostK, Kara Erickson, Kristiyan Kostadinov, Martin Probst, Matthias Weiß, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, Sabareesh Kappagantu, WD Snoeijer, angular-robot[bot], arturovt, ced, dario-piotrowicz, ivanwonder and jaybell
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.2.6"></a>
# 14.2.6 (2022-10-12)
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [3fd176a905](https://github.com/angular/angular/commit/3fd176a9054bea6f6c4cd22e8ff3b8f63b86b637) | fix | add missing period to error message ([#47744](https://github.com/angular/angular/pull/47744)) |
| [c3821f5ab5](https://github.com/angular/angular/commit/c3821f5ab5bf54b2c9d7868da79a742d4e4b7667) | perf | minimize filesystem calls when generating shims ([#47682](https://github.com/angular/angular/pull/47682)) |
## Special Thanks
Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, Charles Lyding, Joey Perrott, Joshua Morony, Mathew Berg, Paul Gschwendtner, Peter Dickten, Renan Ferro, Sri Ram, WD Snoeijer, markostanimirovic and Álvaro Martínez
<!-- CHANGELOG SPLIT MARKER -->
@@ -90,35 +199,6 @@ Alexander Wiebe, Ciprian Sauliuc, Dmytro Mezhenskyi, George Kalpakas, Joe Martin
<!-- CHANGELOG SPLIT MARKER -->
<a name="15.0.0-next.4"></a>
# 15.0.0-next.4 (2022-09-28)
## Breaking Changes
### router
- The title property is now required on ActivatedRouteSnapshot
## Deprecations
### core
- The bit field signature of `Injector.get()` has been deprecated, in favor of the new options object.
- The bit field signature of `TestBed.inject()` has been deprecated, in favor of the new options object.
### core
| Commit | Type | Description |
| -- | -- | -- |
| [841c8e5138](https://github.com/angular/angular/commit/841c8e51386645d7fd26642f41952ed8f0a2dbe5) | feat | support object-based DI flags in Injector.get() ([#46761](https://github.com/angular/angular/pull/46761)) |
| [120555a626](https://github.com/angular/angular/commit/120555a626d66523e46ce01681b11a0f38e3a40a) | feat | support object-based DI flags in TestBed.inject() ([#46761](https://github.com/angular/angular/pull/46761)) |
| [aef8d0bb02](https://github.com/angular/angular/commit/aef8d0bb020931e0b44e067b074a449fc66f6ff7) | fix | correctly check for `typeof` of undefined in `ngDevMode` check ([#47480](https://github.com/angular/angular/pull/47480)) |
| [85330f3fd9](https://github.com/angular/angular/commit/85330f3fd9ac6381ce3aa18479ed8195d2ac215e) | fix | update `isDevMode` to rely on `ngDevMode` ([#47475](https://github.com/angular/angular/pull/47475)) |
### language-service
| Commit | Type | Description |
| -- | -- | -- |
| [e7ee53c541](https://github.com/angular/angular/commit/e7ee53c541da0a1f85c217354ec9901010ae0de9) | feat | support to fix invalid banana in box ([#47393](https://github.com/angular/angular/pull/47393)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [6a88bad019](https://github.com/angular/angular/commit/6a88bad0192516f26a5a008c0634b73456b9447c) | fix | Ensure ActivatedRouteSnapshot#title has correct value ([#47481](https://github.com/angular/angular/pull/47481)) |
## Special Thanks
Alan Agius, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Ashley Hunter, Doug Parker, Jessica Janiuk, JiaLiPassion, Kristiyan Kostadinov, Rokas Brazdžionis, Simona Cotin and ivanwonder
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.2.4"></a>
# 14.2.4 (2022-09-28)
### compiler-cli
@@ -134,21 +214,6 @@ Alan Agius, Ashley Hunter, Doug Parker, Jessica Janiuk, JoostK, Kristiyan Kostad
<!-- CHANGELOG SPLIT MARKER -->
<a name="15.0.0-next.3"></a>
# 15.0.0-next.3 (2022-09-21)
### animations
| Commit | Type | Description |
| -- | -- | -- |
| [d11b1d99b0](https://github.com/angular/angular/commit/d11b1d99b0af1bc6389ef0e0157c5bca8a7f951a) | fix | make sure that the useAnimation function delay is applied ([#47468](https://github.com/angular/angular/pull/47468)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [8fcadaad48](https://github.com/angular/angular/commit/8fcadaad48b2b1328f47b7603b230445a26f95a8) | perf | cache source file for reporting type-checking diagnostics ([#47471](https://github.com/angular/angular/pull/47471)) |
## Special Thanks
AleksanderBodurri, Andrew Kushnir, Andrew Scott, Bob Watson, George Kalpakas, JiaLiPassion, Joey Perrott, JoostK, Kristiyan Kostadinov, Mauro Mattos, Pawel Kozlowski, Sabareesh Kappagantu, angular-robot[bot], dario-piotrowicz, fabioemoutinho and famzila
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.2.3"></a>
# 14.2.3 (2022-09-21)
### animations
@@ -160,29 +225,6 @@ AleksanderBodurri, Andrew Kushnir, Andrew Scott, Bob Watson, George Kalpakas, Jo
<!-- CHANGELOG SPLIT MARKER -->
<a name="15.0.0-next.2"></a>
# 15.0.0-next.2 (2022-09-14)
### animations
| Commit | Type | Description |
| -- | -- | -- |
| [7ec196e0fb](https://github.com/angular/angular/commit/7ec196e0fb7d73caada1f502758cab0950e3a272) | fix | make sure that the animation function delay is applied ([#47285](https://github.com/angular/angular/pull/47285)) |
### common
| Commit | Type | Description |
| -- | -- | -- |
| [ca7bf65933](https://github.com/angular/angular/commit/ca7bf6593380fa760891d29fba5c9f61c6e9bf8b) | fix | rename `rawSrc` -> `ngSrc` in NgOptimizedImage directive ([#47362](https://github.com/angular/angular/pull/47362)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [4e10a74941](https://github.com/angular/angular/commit/4e10a7494130b9bb4772ee8f76b66675867b2145) | fix | imply @Optional flag when a default value is provided ([#47242](https://github.com/angular/angular/pull/47242)) |
### forms
| Commit | Type | Description |
| -- | -- | -- |
| [4a13210ecd](https://github.com/angular/angular/commit/4a13210ecd692aaace7f67fadf25741f3f0cc50b) | fix | don't prevent default behavior for forms with method="dialog" ([#47308](https://github.com/angular/angular/pull/47308)) |
## Special Thanks
Abhishek Rawat, Andrew Kushnir, Benjamin Chanudet, Bob Watson, Dylan Hunn, George Kalpakas, Ikko Ashimine, Joey Perrott, Kristiyan Kostadinov, Marc Wrobel, Mariia Subkov, Pawel Kozlowski, Sebastian, abergquist, dario-piotrowicz, onrails and vyom1611
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.2.2"></a>
# 14.2.2 (2022-09-14)
### animations
@@ -206,41 +248,6 @@ Abhishek Rawat, Andrew Kushnir, Benjamin Chanudet, Bob Watson, George Kalpakas,
<!-- CHANGELOG SPLIT MARKER -->
<a name="15.0.0-next.1"></a>
# 15.0.0-next.1 (2022-09-07)
## Breaking Changes
### compiler-cli
- Angular compiler option `enableIvy` has been removed as Ivy is the only rendering engine.
### localize
- - `canParse` method has been removed from all translation parsers in `@angular/localize/tools`. `analyze` should be used instead.
- the `hint` parameter in the`parse` methods is now mandatory.
### common
| Commit | Type | Description |
| -- | -- | -- |
| [220d1203e6](https://github.com/angular/angular/commit/220d1203e66116bfcf69204ebac2092eb638bb75) | fix | improve formatting of image warnings ([#47299](https://github.com/angular/angular/pull/47299)) |
| [93d7d9101e](https://github.com/angular/angular/commit/93d7d9101e56a51f1ce315b1d0e67fa02e8916d9) | fix | use DOCUMENT token to query for preconnect links ([#47353](https://github.com/angular/angular/pull/47353)) |
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [cf0c53aa1c](https://github.com/angular/angular/commit/cf0c53aa1c54bf747529a9f7899e68c71249fc9d) | fix | avoid errors for inputs with Object-builtin names ([#47220](https://github.com/angular/angular/pull/47220)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [16f96eeabf](https://github.com/angular/angular/commit/16f96eeabf77964092b4b6a830e29f2761ffaeec) | refactor | remove `enableIvy` options ([#47346](https://github.com/angular/angular/pull/47346)) |
### localize
| Commit | Type | Description |
| -- | -- | -- |
| [d36fd3d9e4](https://github.com/angular/angular/commit/d36fd3d9e41984818af5e1aad5e3004574d837bb) | refactor | remove deprecated `canParse` method from TranslationParsers ([#47275](https://github.com/angular/angular/pull/47275)) |
### service-worker
| Commit | Type | Description |
| -- | -- | -- |
| [e1bb638e0b](https://github.com/angular/angular/commit/e1bb638e0bc9cf2da4ba3aa8ad7b549164ad5c12) | fix | include headers in requests for assets ([#47260](https://github.com/angular/angular/pull/47260)) |
| [a0c3326485](https://github.com/angular/angular/commit/a0c3326485548e8d9b193f5472a9b02a02d679a6) | fix | only consider GET requests as navigation requests ([#47263](https://github.com/angular/angular/pull/47263)) |
## Special Thanks
Alan Agius, Andrew Kushnir, Aristeidis Bampakos, Asaf M, Bingo's Code, Bob Watson, Daniel Ostrovsky, George Kalpakas, Giovanni Alberto Rivas, Jeremy Elbourn, JiaLiPassion, Jobayer Hossain, Joe Martin (Crowdstaffing), Joey Perrott, JoostK, Kara Erickson, Kristiyan Kostadinov, Maina Wycliffe, Sabareesh Kappagantu, Simona Cotin, Sonu Sindhu, Yann Provoost, abergquist, angular-robot[bot], jaybell and vyom1611
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.2.1"></a>
# 14.2.1 (2022-09-07)
### common
@@ -262,16 +269,6 @@ Aristeidis Bampakos, Asaf M, Bingo's Code, Bob Watson, Daniel Ostrovsky, George
<!-- CHANGELOG SPLIT MARKER -->
<a name="15.0.0-next.0"></a>
### router
| Commit | Type | Description |
| -- | -- | -- |
| [5163e3d876](https://github.com/angular/angular/commit/5163e3d876cdfd6d309d7e35aefa6f07ef62715e) | feat | Add UrlTree constructor to public API ([#47186](https://github.com/angular/angular/pull/47186)) |
## Special Thanks
Alan Agius, Alex Rickabaugh, Andrew Scott, Joey Perrott, Kara Erickson, Kristiyan Kostadinov and Pawel Kozlowski
<!-- CHANGELOG SPLIT MARKER -->
<a name="14.2.0"></a>
# 14.2.0 (2022-08-25)
### animations
-16
View File
@@ -1,16 +0,0 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
@@ -1,62 +0,0 @@
# Gathering and Viewing Usage Analytics
Users can opt in to share their Angular CLI usage data with [Google Analytics](https://support.google.com/analytics/answer/1008015?hl=en), using the [`ng analytics` CLI command](analytics).
The data is also shared with the Angular team, and used to improve the CLI.
The gathering of CLI analytics data is disabled by default, and must be enabled at the project level by individual users.
It cannot be enabled at the project level for all users.
Data gathered in this way can be viewed on the Google Analytics site, but is not automatically visible on your own organization's Analytics site.
As an administrator for an Angular development group, you can configure your instance of Angular CLI to be able to see analytics data for your own team's usage of the Angular CLI.
This configuration option is separate from and in addition to other usage analytics that your users may be sharing with Google.
## Enable access to CLI usage data
To configure access to your own users' CLI usage data, use the `ng config` command to add a key to your global [`angular.json` workspace configuration file](guide/workspace-config).
The key goes under `cli.analyticsSharing` at the top level of the file, outside the `projects` sections.
The value of the key is your organization's tracking ID, as assigned by Google Analytics.
This ID is a string that looks like `UA-123456-12`.
You can choose to use a descriptive string as the key value, or be assigned a random key when you run the CLI command.
For example, the following command adds a configuration key named "tracking".
<code-example format="shell" language="shell">
ng config --global cli.analyticsSharing.tracking UA-123456-12
</code-example>
To turn off this feature, run the following command:
<code-example format="shell" language="shell">
ng config --global cli.analyticsSharing undefined
</code-example>
## Per user tracking
You can add a custom user ID to the global configuration, in order to identify unique usage of commands and flags.
If that user enables CLI analytics for their own project, your analytics display tracks and labels their individual usage.
<code-example format="shell" language="shell">
ng config --global cli.analyticsSharing.uuid SOME_USER_NAME
</code-example>
To generate a new random user ID, run the following command:
<code-example format="shell" language="shell">
ng config --global cli.analyticsSharing.uuid ""
</code-example>
<!-- links -->
<!-- external links -->
<!-- end links -->
@reviewed 2022-02-28
+28
View File
@@ -0,0 +1,28 @@
@name Missing value accessor
@category runtime
@shortDescription You must register an `NgValueAccessor` with a custom form control
@description
For all custom form controls, you must register a value accessor.
Here's an example of how to provide one:
```typescript
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => MyInputField),
multi: true,
}
]
```
@debugging
As described above, your control was expected to have a value accessor, but was missing one. However, there are many different reasons this can happen in practice. Here's a listing of some known problems leading to this error.
1. If you **defined** a custom form control, did you remember to provide a value accessor?
1. Did you put `ngModel` on an element with no value, or an **invalid element** (e.g. `<div [(ngModel)]="foo">`)?
1. Are you using a custom form control declared inside an `NgModule`? if so, make sure you are **importing** the `NgModule`.
1. Are you using `ngModel` with a third-party custom form control? Check whether that control provides a value accessor. If not, use **`ngDefaultControl`** on the control's element.
1. Are you **testing** a custom form control? Be sure to configure your testbed to know about the control. You can do so with `Testbed.configureTestingModule`.
1. Are you using **Nx and Module Federation** with Webpack? Your `webpack.config.js` may require [extra configuration](https://github.com/angular/angular/issues/43821#issuecomment-1054845431) to ensure the forms package is shared.
+71
View File
@@ -0,0 +1,71 @@
@name Unsafe bindings on an iframe element
@category runtime
@shortDescription Unsafe bindings on an iframe element
@description
You see this error when Angular detects an attribute binding or a property binding on an `<iframe>` element using the following property names:
* sandbox
* allow
* allowFullscreen
* referrerPolicy
* csp
* fetchPriority
The mentioned attributes affect the security model setup for `<iframe>`s
and it's important to apply them before setting the `src` or `srcdoc` attributes.
To enforce that, Angular requires these attributes to be set on `<iframe>`s as
static attributes, so the values are set at the element creation time and they
remain the same throughout the lifetime of an `<iframe>` instance.
The error is thrown when a property binding with one of the mentioned attribute names is used:
```html
<iframe [sandbox]="'allow-scripts'" src="..."></iframe>
```
or when it's an attribute bindings:
```html
<iframe [attr.sandbox]="'allow-scripts'" src="..."></iframe>
```
Also, the error is thrown when a similar pattern is used in Directive's host bindings:
```typescript
@Directive({
selector: 'iframe',
host: {
'[sandbox]': `'allow-scripts'`,
'[attr.sandbox]': `'allow-scripts'`,
}
})
class IframeDirective {}
```
@debugging
The error message includes the name of the component with the template where
an `<iframe>` element with unsafe bindings is located.
The recommended solution is to use the mentioned attributes as static ones, for example:
```html
<iframe sandbox="allow-scripts" src="..."></iframe>
```
If you need to have different values for these attributes (depending on various conditions),
you can use an `*ngIf` or an `*ngSwitch` on an `<iframe>` element:
```html
<iframe *ngIf="someConditionA" sandbox="allow-scripts" src="..."></iframe>
<iframe *ngIf="someConditionB" sandbox="allow-forms" src="..."></iframe>
<iframe *ngIf="someConditionC" sandbox="allow-popups" src="..."></iframe>
```
<!-- links -->
<!-- external links -->
<!-- end links -->
@reviewed 2022-05-27
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -9,8 +9,7 @@
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
@@ -42,4 +41,3 @@
},
}
// #enddocregion angular-compiler-options-app
+2 -7
View File
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
.catch(err => console.error(err));
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
.catch(err => console.error(err));
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,8 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
platformBrowserDynamic().bootstrapModule(AppModule);
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
+2 -7
View File
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
.catch(err => console.error(err));
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
.catch(err => console.error(err));
+2 -7
View File
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,28 +1,37 @@
// This tsconfig is used in the TypeScript
// configuration guide (../guide/typescript-configuration.md)
// configuration guide (../guide/typescript-configuration.md)
// to display the latest default configuration
// Note: Update with every major release to the latest default
// #docregion
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
// #docregion lib
"target": "ES2022",
"module": "ES2022",
"useDefineForClassFields": false,
"lib": [
"es2018",
"ES2022",
"dom"
]
// #enddocregion lib
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
+2 -7
View File
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
+2 -15
View File
@@ -8,11 +8,6 @@
"angular.io-example": {
// #enddocregion locale-config, i18n-baseHref
"projectType": "application",
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
@@ -42,7 +37,7 @@
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
@@ -68,12 +63,6 @@
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
@@ -124,10 +113,8 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
+2 -7
View File
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
.catch(err => console.error(err));
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
+2 -7
View File
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
+2 -7
View File
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
+2 -7
View File
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
.catch(err => console.error(err));
+2 -7
View File
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -4,7 +4,7 @@ import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
// #docregion admin-route
import {AuthGuard} from '../auth/auth.guard';
import {authGuard} from '../auth/auth.guard';
import {AdminDashboardComponent} from './admin-dashboard/admin-dashboard.component';
import {AdminComponent} from './admin/admin.component';
@@ -14,11 +14,11 @@ import {ManageHeroesComponent} from './manage-heroes/manage-heroes.component';
const adminRoutes: Routes = [{
path: 'admin',
component: AdminComponent,
canActivate: [AuthGuard],
canActivate: [authGuard],
// #enddocregion admin-route
// #docregion can-match
canMatch: [AuthGuard],
canMatch: [authGuard],
// #enddocregion can-match
// #docregion admin-route
children: [{
@@ -29,7 +29,7 @@ const adminRoutes: Routes = [{
{path: '', component: AdminDashboardComponent}
],
// #enddocregion admin-route
canActivateChild: [AuthGuard]
canActivateChild: [authGuard]
// #docregion admin-route
}]
}];
@@ -8,18 +8,18 @@ import { AdminDashboardComponent } from './admin-dashboard/admin-dashboard.compo
import { ManageCrisesComponent } from './manage-crises/manage-crises.component';
import { ManageHeroesComponent } from './manage-heroes/manage-heroes.component';
import { AuthGuard } from '../auth/auth.guard';
import { authGuard } from '../auth/auth.guard';
// #docregion can-activate-child
const adminRoutes: Routes = [
{
path: 'admin',
component: AdminComponent,
canActivate: [AuthGuard],
canActivate: [authGuard],
children: [
{
path: '',
canActivateChild: [AuthGuard],
canActivateChild: [authGuard],
children: [
{ path: 'crises', component: ManageCrisesComponent },
{ path: 'heroes', component: ManageHeroesComponent },
@@ -8,17 +8,17 @@ import { AdminDashboardComponent } from './admin-dashboard/admin-dashboard.compo
import { ManageCrisesComponent } from './manage-crises/manage-crises.component';
import { ManageHeroesComponent } from './manage-heroes/manage-heroes.component';
import { AuthGuard } from '../auth/auth.guard';
import { authGuard } from '../auth/auth.guard';
const adminRoutes: Routes = [
{
path: '',
component: AdminComponent,
canActivate: [AuthGuard],
canActivate: [authGuard],
children: [
{
path: '',
canActivateChild: [AuthGuard],
canActivateChild: [authGuard],
children: [
{ path: 'crises', component: ManageCrisesComponent },
{ path: 'heroes', component: ManageHeroesComponent },
@@ -2,7 +2,7 @@
import {Injectable, NgModule} from '@angular/core';
import {Title} from '@angular/platform-browser';
import {
Resolve,
ResolveFn,
RouterModule,
RouterStateSnapshot,
Routes,
@@ -18,7 +18,7 @@ const routes: Routes = [
children: [
{
path: 'child-a', // child route path
title: ResolvedChildATitle,
title: resolvedChildATitle,
component: ChildAComponent, // child route component that the router renders
},
{
@@ -30,12 +30,7 @@ const routes: Routes = [
},
];
@Injectable({providedIn: 'root'})
export class ResolvedChildATitle implements Resolve<string> {
resolve() {
return Promise.resolve('child a');
}
}
const resolvedChildATitle: ResolveFn<string> = () => Promise.resolve('child a');
// #enddocregion page-title
@@ -6,7 +6,7 @@ import { RouterModule, Routes } from '@angular/router';
import { ComposeMessageComponent } from './compose-message/compose-message.component';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { AuthGuard } from './auth/auth.guard';
import { authGuard } from './auth/auth.guard';
const appRoutes: Routes = [
@@ -20,7 +20,7 @@ const appRoutes: Routes = [
path: 'admin',
loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule),
// #enddocregion admin-1
canLoad: [AuthGuard]
canLoad: [authGuard]
// #docregion admin-1
},
// #enddocregion admin, admin-1
@@ -11,7 +11,7 @@ import {
import { ComposeMessageComponent } from './compose-message/compose-message.component';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { AuthGuard } from './auth/auth.guard';
import { authGuard } from './auth/auth.guard';
const appRoutes: Routes = [
{
@@ -22,7 +22,7 @@ const appRoutes: Routes = [
{
path: 'admin',
loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule),
canLoad: [AuthGuard]
canLoad: [authGuard]
},
{
path: 'crisis-center',
@@ -6,7 +6,7 @@ import { RouterModule, Routes } from '@angular/router';
import { ComposeMessageComponent } from './compose-message/compose-message.component';
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { AuthGuard } from './auth/auth.guard';
import { authGuard } from './auth/auth.guard';
import { SelectivePreloadingStrategyService } from './selective-preloading-strategy.service';
const appRoutes: Routes = [
@@ -18,7 +18,7 @@ const appRoutes: Routes = [
{
path: 'admin',
loadChildren: () => import('./admin/admin.module').then(m => m.AdminModule),
canLoad: [AuthGuard]
canLoad: [authGuard]
},
// #docregion preload-v2
{
@@ -1,7 +1,7 @@
// #docregion
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuard } from './auth.guard';
import { authGuard } from './auth.guard';
import { AuthService } from './auth.service';
import { LoginComponent } from './login/login.component';
@@ -1,15 +1,8 @@
// #docregion
import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { CanActivateFn } from '@angular/router';
@Injectable({
providedIn: 'root',
})
export class AuthGuard implements CanActivate {
canActivate(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): boolean {
console.log('AuthGuard#canActivate called');
return true;
}
}
export const authGuard: CanActivateFn = () => {
console.log('authGuard#canActivate called');
return true;
};
// #enddocregion
@@ -1,45 +1,22 @@
// #docregion
import {Injectable} from '@angular/core';
import {inject} from '@angular/core';
import {
ActivatedRouteSnapshot, CanActivate, CanMatch,
Route, Router, RouterStateSnapshot, UrlTree
CanActivateFn, CanMatchFn,
Router, UrlTree
} from '@angular/router';
import {AuthService} from './auth.service';
@Injectable({
providedIn: 'root',
})
export class AuthGuard implements CanActivate, CanMatch {
constructor(private authService: AuthService, private router: Router) {}
export const authGuard: CanMatchFn|CanActivateFn = () => {
const authService = inject(AuthService);
const router = inject(Router);
canActivate(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): true|UrlTree {
const url: string = state.url;
return this.checkLogin(url);
if (authService.isLoggedIn) {
return true;
}
// #enddocregion
// #docregion can-match
canMatch(route: Route) {
const url = `/${route.path}`;
return this.checkLogin(url) === true;
}
// #enddocregion can-match
// #docregion
// Redirect to the login page
return router.parseUrl('/login');
};
checkLogin(url: string): true|UrlTree {
if (this.authService.isLoggedIn) {
return true;
}
// Store the attempted URL for redirecting
this.authService.redirectUrl = url;
// Redirect to the login page
return this.router.parseUrl('/login');
}
}
// #enddocregion
@@ -1,44 +1,20 @@
// #docregion can-activate-child
import { Injectable } from '@angular/core';
import { inject } from '@angular/core';
import {
CanActivate, Router,
ActivatedRouteSnapshot,
RouterStateSnapshot,
CanActivateChild,
CanActivateFn, CanMatchFn, Router,
CanActivateChildFn,
UrlTree
} from '@angular/router';
import { AuthService } from './auth.service';
@Injectable({
providedIn: 'root',
})
export class AuthGuard implements CanActivate, CanActivateChild {
constructor(private authService: AuthService, private router: Router) {}
export const authGuard: CanMatchFn|CanActivateFn|CanActivateChildFn = () => {
const authService = inject(AuthService);
const router = inject(Router);
canActivate(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): true|UrlTree {
const url: string = state.url;
return this.checkLogin(url);
if (authService.isLoggedIn) {
return true;
}
canActivateChild(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): true|UrlTree {
return this.canActivate(route, state);
}
// #enddocregion can-activate-child
checkLogin(url: string): true|UrlTree {
if (this.authService.isLoggedIn) { return true; }
// Store the attempted URL for redirecting
this.authService.redirectUrl = url;
// Redirect to the login page
return this.router.parseUrl('/login');
}
// #docregion can-activate-child
}
// #enddocregion
// Redirect to the login page
return router.parseUrl('/login');
};
@@ -1,49 +1,33 @@
// #docplaster
// #docregion
import { Injectable } from '@angular/core';
import { inject } from '@angular/core';
import {
CanActivate, Router,
ActivatedRouteSnapshot,
RouterStateSnapshot,
CanActivateChild,
CanActivateFn, CanMatchFn, Router,
CanActivateChildFn,
NavigationExtras,
UrlTree
} from '@angular/router';
import { AuthService } from './auth.service';
@Injectable({
providedIn: 'root',
})
export class AuthGuard implements CanActivate, CanActivateChild {
constructor(private authService: AuthService, private router: Router) {}
export const authGuard: CanMatchFn|CanActivateFn|CanActivateChildFn = () => {
const authService = inject(AuthService);
const router = inject(Router);
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): true|UrlTree {
const url: string = state.url;
return this.checkLogin(url);
if (authService.isLoggedIn) {
return true;
}
canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): true|UrlTree {
return this.canActivate(route, state);
}
// Create a dummy session id
const sessionId = 123456789;
checkLogin(url: string): true|UrlTree {
if (this.authService.isLoggedIn) { return true; }
// Set our navigation extras object
// that contains our global query params and fragment
const navigationExtras: NavigationExtras = {
queryParams: { session_id: sessionId },
fragment: 'anchor'
};
// Store the attempted URL for redirecting
this.authService.redirectUrl = url;
// Redirect to the login page with extras
return router.createUrlTree(['/login'], navigationExtras);
};
// Create a dummy session id
const sessionId = 123456789;
// Set our navigation extras object
// that contains our global query params and fragment
const navigationExtras: NavigationExtras = {
queryParams: { session_id: sessionId },
fragment: 'anchor'
};
// Redirect to the login page with extras
return this.router.createUrlTree(['/login'], navigationExtras);
}
}
@@ -1,57 +1,33 @@
// #docplaster
import { Injectable } from '@angular/core';
import { inject } from '@angular/core';
import {
CanActivate, Router,
ActivatedRouteSnapshot,
RouterStateSnapshot,
CanActivateChild,
CanActivateFn, CanMatchFn, Router,
CanActivateChildFn,
NavigationExtras,
CanLoad, Route
CanLoadFn, UrlTree
} from '@angular/router';
import { AuthService } from './auth.service';
@Injectable({
providedIn: 'root',
})
export class AuthGuard implements CanActivate, CanActivateChild, CanLoad {
constructor(private authService: AuthService, private router: Router) {}
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
const url: string = state.url;
return this.checkLogin(url);
}
canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
return this.canActivate(route, state);
}
// #docregion, canLoad
canLoad(route: Route): boolean {
const url = `/${route.path}`;
return this.checkLogin(url);
}
// #docregion canLoad
export const authGuard: CanMatchFn|CanActivateChildFn|CanActivateFn|CanLoadFn = () => {
// #enddocregion canLoad
const router = inject(Router);
const authService = inject(AuthService);
checkLogin(url: string): boolean {
if (this.authService.isLoggedIn) { return true; }
// Store the attempted URL for redirecting
this.authService.redirectUrl = url;
// Create a dummy session id
const sessionId = 123456789;
// Set our navigation extras object
// that contains our global query params and fragment
const navigationExtras: NavigationExtras = {
queryParams: { session_id: sessionId },
fragment: 'anchor'
};
// Navigate to the login page with extras
this.router.navigate(['/login'], navigationExtras);
return false;
if (authService.isLoggedIn) {
return true;
}
}
// Create a dummy session id
const sessionId = 123456789;
// Set our navigation extras object
// that contains our global query params and fragment
const navigationExtras: NavigationExtras = {
queryParams: { session_id: sessionId },
fragment: 'anchor'
};
// Navigate to the login page with extras
return router.createUrlTree(['/login'], navigationExtras);
};
@@ -1,22 +1,16 @@
// #docregion
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { CanDeactivate,
import { CanDeactivateFn,
ActivatedRouteSnapshot,
RouterStateSnapshot } from '@angular/router';
import { CrisisDetailComponent } from './crisis-center/crisis-detail/crisis-detail.component';
@Injectable({
providedIn: 'root',
})
export class CanDeactivateGuard implements CanDeactivate<CrisisDetailComponent> {
canDeactivate(
export const canDeactivateGuard: CanDeactivateFn<CrisisDetailComponent> = (
component: CrisisDetailComponent,
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
): Observable<boolean> | boolean {
): Observable<boolean> | boolean => {
// Get the Crisis Center ID
console.log(route.paramMap.get('id'));
@@ -30,5 +24,4 @@ export class CanDeactivateGuard implements CanDeactivate<CrisisDetailComponent>
// Otherwise ask the user with the dialog service and return its
// observable which resolves to true or false when the user decides
return component.dialogService.confirm('Discard changes?');
}
}
};
@@ -1,17 +1,10 @@
// #docregion
import { Injectable } from '@angular/core';
import { CanDeactivate } from '@angular/router';
import { CanDeactivateFn } from '@angular/router';
import { Observable } from 'rxjs';
export interface CanComponentDeactivate {
canDeactivate: () => Observable<boolean> | Promise<boolean> | boolean;
canDeactivate?: () => Observable<boolean> | Promise<boolean> | boolean;
}
@Injectable({
providedIn: 'root',
})
export class CanDeactivateGuard implements CanDeactivate<CanComponentDeactivate> {
canDeactivate(component: CanComponentDeactivate) {
return component.canDeactivate ? component.canDeactivate() : true;
}
}
export const canDeactivateGuard: CanDeactivateFn<CanComponentDeactivate> =
(component: CanComponentDeactivate) => component.canDeactivate ? component.canDeactivate() : true;
@@ -6,8 +6,8 @@ import { CrisisListComponent } from './crisis-list/crisis-list.component';
import { CrisisCenterComponent } from './crisis-center/crisis-center.component';
import { CrisisDetailComponent } from './crisis-detail/crisis-detail.component';
import { CanDeactivateGuard } from '../can-deactivate.guard';
import { CrisisDetailResolverService } from './crisis-detail-resolver.service';
import { canDeactivateGuard } from '../can-deactivate.guard';
import { crisisDetailResolver} from './crisis-detail-resolver';
const crisisCenterRoutes: Routes = [
@@ -22,9 +22,9 @@ const crisisCenterRoutes: Routes = [
{
path: ':id',
component: CrisisDetailComponent,
canDeactivate: [CanDeactivateGuard],
canDeactivate: [canDeactivateGuard],
resolve: {
crisis: CrisisDetailResolverService
crisis: crisisDetailResolver
}
},
{
@@ -6,7 +6,7 @@ import { CrisisListComponent } from './crisis-list/crisis-list.component';
import { CrisisCenterComponent } from './crisis-center/crisis-center.component';
import { CrisisDetailComponent } from './crisis-detail/crisis-detail.component';
import { CanDeactivateGuard } from '../can-deactivate.guard';
import { canDeactivateGuard } from '../can-deactivate.guard';
const crisisCenterRoutes: Routes = [
{
@@ -20,7 +20,7 @@ const crisisCenterRoutes: Routes = [
{
path: ':id',
component: CrisisDetailComponent,
canDeactivate: [CanDeactivateGuard]
canDeactivate: [canDeactivateGuard]
},
{
path: '',
@@ -8,8 +8,8 @@ import { CrisisListComponent } from './crisis-list/crisis-list.component';
import { CrisisCenterComponent } from './crisis-center/crisis-center.component';
import { CrisisDetailComponent } from './crisis-detail/crisis-detail.component';
import { CanDeactivateGuard } from '../can-deactivate.guard';
import { CrisisDetailResolverService } from './crisis-detail-resolver.service';
import { canDeactivateGuard } from '../can-deactivate.guard';
import { crisisDetailResolver } from './crisis-detail-resolver';
const crisisCenterRoutes: Routes = [
{
@@ -23,9 +23,9 @@ const crisisCenterRoutes: Routes = [
{
path: ':id',
component: CrisisDetailComponent,
canDeactivate: [CanDeactivateGuard],
canDeactivate: [canDeactivateGuard],
resolve: {
crisis: CrisisDetailResolverService
crisis: crisisDetailResolver
}
},
{
@@ -8,8 +8,8 @@ import { CrisisListComponent } from './crisis-list/crisis-list.component';
import { CrisisCenterComponent } from './crisis-center/crisis-center.component';
import { CrisisDetailComponent } from './crisis-detail/crisis-detail.component';
import { CanDeactivateGuard } from '../can-deactivate.guard';
import { CrisisDetailResolverService } from './crisis-detail-resolver.service';
import { canDeactivateGuard } from '../can-deactivate.guard';
import { crisisDetailResolver } from './crisis-detail-resolver';
const crisisCenterRoutes: Routes = [
{
@@ -23,9 +23,9 @@ const crisisCenterRoutes: Routes = [
{
path: ':id',
component: CrisisDetailComponent,
canDeactivate: [CanDeactivateGuard],
canDeactivate: [canDeactivateGuard],
resolve: {
crisis: CrisisDetailResolverService
crisis: crisisDetailResolver
}
},
{
@@ -0,0 +1,4 @@
// #docregion
export function crisisDetailResolver() {
}
@@ -1,11 +0,0 @@
// #docregion
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class CrisisDetailResolverService {
constructor() { }
}
@@ -1,34 +0,0 @@
// #docregion
import { Injectable } from '@angular/core';
import {
Router, Resolve,
RouterStateSnapshot,
ActivatedRouteSnapshot
} from '@angular/router';
import { Observable, of, EMPTY } from 'rxjs';
import { mergeMap } from 'rxjs/operators';
import { CrisisService } from './crisis.service';
import { Crisis } from './crisis';
@Injectable({
providedIn: 'root',
})
export class CrisisDetailResolverService implements Resolve<Crisis> {
constructor(private cs: CrisisService, private router: Router) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Crisis> | Observable<never> {
const id = route.paramMap.get('id')!;
return this.cs.getCrisis(id).pipe(
mergeMap(crisis => {
if (crisis) {
return of(crisis);
} else { // id not found
this.router.navigate(['/crisis-center']);
return EMPTY;
}
})
);
}
}
@@ -0,0 +1,23 @@
// #docregion
import {inject} from '@angular/core';
import {ActivatedRouteSnapshot, ResolveFn, Router} from '@angular/router';
import {EMPTY, of} from 'rxjs';
import {mergeMap} from 'rxjs/operators';
import {Crisis} from './crisis';
import {CrisisService} from './crisis.service';
export const crisisDetailResolver: ResolveFn<Crisis> = (route: ActivatedRouteSnapshot) => {
const router = inject(Router);
const cs = inject(CrisisService);
const id = route.paramMap.get('id')!;
return cs.getCrisis(id).pipe(mergeMap(crisis => {
if (crisis) {
return of(crisis);
} else { // id not found
router.navigate(['/crisis-center']);
return EMPTY;
}
}));
};
+2 -1
View File
@@ -3,4 +3,5 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -3,4 +3,5 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
+2 -8
View File
@@ -1,13 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,9 +1,8 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgModule, isDevMode } from '@angular/core';
import { AppComponent } from './app.component';
import { ServiceWorkerModule } from '@angular/service-worker';
import { environment } from '../environments/environment';
import { CheckForUpdateService } from './check-for-update.service';
import { LogUpdateService } from './log-update.service';
@@ -15,7 +14,7 @@ import { PromptUpdateService } from './prompt-update.service';
],
imports: [
BrowserModule,
ServiceWorkerModule.register('/ngsw-worker.js', {enabled: environment.production})
ServiceWorkerModule.register('/ngsw-worker.js', {enabled: !isDevMode()})
],
providers: [
CheckForUpdateService,
@@ -1,12 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));
.catch(err => console.error(err));
+3 -1
View File
@@ -1,5 +1,7 @@
// #docregion
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,12 +1,7 @@
// #docregion
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
@@ -1,11 +1,6 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
+2 -7
View File
@@ -1,12 +1,7 @@
// main app entry point
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));

Some files were not shown because too many files have changed in this diff Show More