701 Commits

Author SHA1 Message Date
Paul Gschwendtner 1146107778 test: update size goldens to reflect devkit update and terser (#49027)
The Angular devkit updated Terser. Terser landed various changes
related to variable inlining. Most constants are no longer inlined,
but instead the variables are re-used.

This led to a bundle size increase of around ~600B in AIO and most
integration tests.

Here is an example diff:
https://screenshot.googleplex.com/4M8owBYDAqU982T

PR Close #49027
2023-02-10 19:21:29 +00:00
Dylan Hunn 5f2a3edcf2 fix(forms): Make radio buttons respect [attr.disabled] (#48864)
`setDisabledState` is supposed to be called whenever the disabled state of a control changes, including upon control creation. However, a longstanding bug caused the method to not fire when an *enabled* control was attached. This bug was fixed in v15.

This had a side effect: previously, it was possible to instantiate a reactive form control with `[attr.disabled]=true`, even though the the corresponding control was enabled in the model. (Note that the similar-looking property binding version `[disabled]=true` was always rejected, though.) This resulted in a mismatch between the model and the DOM. Now, because `setDisabledState` is always called, the value in the DOM will be immediately overwritten with the "correct" enabled value.

Users should instead disable the control directly in their model. (There are many ways to do this, such as using the `{value: 'foo', disabled: true}` constructor format, or immediately calling `FooControl.disable()` in `ngOnInit`.)

If this incompatibility is too breaking, you may also opt out using `FormsModule.withConfig` or `ReactiveFormsModule.withConfig` at the time you import it, via the `callSetDisabledState` option.

However, there is an exceptional case: radio buttons. Because Reactive Forms models the entire group of radio buttons as a single `FormControl`, there is no way to control the disabled state for individual radios, so they can no longer be configured as disabled.

In this PR, we have special cased radio buttons to ignore their first call to `setDisabledState` when in `callSetDisabledState: 'always'` mode. This preserves the old behavior.

PR Close #48864
2023-02-10 11:25:12 +01:00
Iván Navarro a334e4efbe fix(common): warn if using ngSrcset without a configured image loader (#48804)
Warn the user in the console in case the `ngSrcset` is present and no
loader is configured. In this case, the default loader is used and
it ignores this attribute.

PR Close #48804
2023-01-25 19:27:01 +00:00
Charles Lyding 067c4ce4fd refactor(localize): bundle message digest algorithm directly in npm package (#48799)
The main entry point for the `@angular/localize` package no longer imports
the `@angular/compiler` package and now has no external dependencies. This
allows the main functionality of the package to be used without requiring
any other Angular packages. Only the message digest algorithm implementation
from the `@angular/compiler` package was being used and this code is now
bundled directly into the final npm package for `@angular/localize`.
The `tooling` secondary entry point still leverages and requires Angular
related packages (`@angular/compiler`/`@angular/compiler-cli`). However,
the tooling functionality is not intended to be used and/or bundled in
a web application.

Closes #48163

PR Close #48799
2023-01-24 18:31:25 +00:00
Alan Agius a89e8afebe test: update size golden to reflect Angular cross dependency updates (#48809)
The increase is caused by changes in Material which causes more CSS to be generated.

Before
```css
.mat-pseudo-checkbox {
  color: #0000008a;
}
.mat-pseudo-checkbox:after {
  color: #fafafa;
}
.mat-pseudo-checkbox-disabled {
  color: #b0b0b0;
}
.mat-primary .mat-pseudo-checkbox-checked,
.mat-primary .mat-pseudo-checkbox-indeterminate {
  background: #1976d2;
}
.mat-pseudo-checkbox-checked,
.mat-pseudo-checkbox-indeterminate,
.mat-accent .mat-pseudo-checkbox-checked,
.mat-accent .mat-pseudo-checkbox-indeterminate {
  background: #d32f2f;
}
.mat-warn .mat-pseudo-checkbox-checked,
.mat-warn .mat-pseudo-checkbox-indeterminate {
  background: #f44336;
}
.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,
.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled {
  background: #b0b0b0;
}
```

After
```css
.mat-pseudo-checkbox-full {
  color: #0000008a;
}
.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled {
  color: #b0b0b0;
}
.mat-primary .mat-pseudo-checkbox-checked.mat-pseudo-checkbox-minimal:after,
.mat-primary
  .mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-minimal:after {
  color: #1976d2;
}
.mat-primary .mat-pseudo-checkbox-checked.mat-pseudo-checkbox-full,
.mat-primary .mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-full {
  background: #1976d2;
}
.mat-primary .mat-pseudo-checkbox-checked.mat-pseudo-checkbox-full:after,
.mat-primary .mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-full:after {
  color: #fafafa;
}
.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-minimal:after,
.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-minimal:after {
  color: #d32f2f;
}
.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-full,
.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-full {
  background: #d32f2f;
}
.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-full:after,
.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-full:after {
  color: #fafafa;
}
.mat-accent .mat-pseudo-checkbox-checked.mat-pseudo-checkbox-minimal:after,
.mat-accent
  .mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-minimal:after {
  color: #d32f2f;
}
.mat-accent .mat-pseudo-checkbox-checked.mat-pseudo-checkbox-full,
.mat-accent .mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-full {
  background: #d32f2f;
}
.mat-accent .mat-pseudo-checkbox-checked.mat-pseudo-checkbox-full:after,
.mat-accent .mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-full:after {
  color: #fafafa;
}
.mat-warn .mat-pseudo-checkbox-checked.mat-pseudo-checkbox-minimal:after,
.mat-warn .mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-minimal:after {
  color: #f44336;
}
.mat-warn .mat-pseudo-checkbox-checked.mat-pseudo-checkbox-full,
.mat-warn .mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-full {
  background: #f44336;
}
.mat-warn .mat-pseudo-checkbox-checked.mat-pseudo-checkbox-full:after,
.mat-warn .mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-full:after {
  color: #fafafa;
}
.mat-pseudo-checkbox-disabled.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-minimal:after,
.mat-pseudo-checkbox-disabled.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-minimal:after {
  color: #b0b0b0;
}
.mat-pseudo-checkbox-disabled.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-full,
.mat-pseudo-checkbox-disabled.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-full {
  background: #b0b0b0;
}
```

Closes #48701

PR Close #48809
2023-01-24 16:44:32 +00:00
Andrew Kushnir 97f6535219 ci: increase payload size for an integration test app (#48772)
The most recent commit added extra logic that brought the payload size above the limit. Likely an actual limit was already pretty close to the threshold, so we are just updating the payload.

PR Close #48772
2023-01-18 13:32:42 -08:00
Paul Gschwendtner 0f8a4f97d6 test: update size golden to reflect Angular cross dependency updates (#48747)
The `main` bundle size has increased, as well as the CSS styles from
Angular Material. Only the `main` bundle exceeded the golden, but
we update all other entries to make future updates easier and to prevent
gradually getting closer and closer to the threshold.

Investigating/comparing the `main` bundles before and after the update
did not unveil any significant changes, except for thousands of
different identifiers, with different length due to mangling. That
seems to be the only reason for having exceeded the threshold.

Very likely there were more size-affecting changes over time. Also
for example the downleveling of class fields for Safari v15 support.
See: https://github.com/angular/angular-cli/issues/24355#issuecomment-1333477033

PR Close #48747
2023-01-17 10:46:45 -08:00
Pawel Kozlowski 032b2bd689 perf(common): avoid excessive DOM mutation in NgClass (#48433)
This commit represents rewrite of the NgClass directive to address
severe performance problem (excessive DOM mutation). The modified
algorithm removes all the known performance clifs and has number of
desirable properties:
- it is shorter and (arguably) easier to follow;
- drops usage of existing differs thus limiting dependencies on other
part of the code without increasing size of the directive;
- doesn't degrade any other performance metrics.

Fixes #25518

PR Close #48433
2023-01-13 10:38:54 -08:00
Alex Rickabaugh dd54f6bd96 fix(core): makeEnvironmentProviders should accept EnvironmentProviders (#48720)
`makeEnvironmentProviders` constructs the wrapped `EnvironmentProviders`
type, which can only be used in environment injectors (not element
injectors). It makes sense that `makeEnvironmentProviders` should be able
to accept existing `EnvironmentProviders`-wrapped providers, since it will
be providing the same guarantee, but the current types do not allow this.

This commit fixes the typings to allow nesting `EnvironmentProviders` and
adds a test to verify that it will work.

PR Close #48720
2023-01-12 13:48:00 -08:00
Matthieu Riegler 8aa8b4b77c fix(forms): Form provider FormsModule.withConfig return a FormsModule (#48526)
Because of a transitive dependency, FormsModule.withConfig wasn't providing FormModule.

fixes: #48519

PR Close #48526
2023-01-05 16:26:22 -08:00
Matthieu Riegler c8310a842d refactor(core): cleanup type any (#48623)
Removing every type any in core with a reference to #9100

PR Close #48623
2023-01-04 12:15:16 -08:00
robertIsaac c5a84851ea docs: add NG0403.md for Bootstrapped NgModule doesn't specify which component to initialize error (#48483)
- update `errors.ts` to annotate the error NG0403, so that the runtime can add a link to that guide when an error is thrown
- update `application_ref_spec.ts` to include the new link of the error
- update `errors.md` as a result of running `yarn bazel test packages/core/test`

Fixes #47985

PR Close #48483
2023-01-04 09:59:24 -08:00
Paul Gschwendtner d0d6966d41 refactor: update packages/localize to be strict ESM (#48521)
The `packages/localize` package still required some trickery
to support CommonJS because tests in the repo were running as CommonJS.

This commit removes the CommonJS logic in localize and its tests, so
that only ESM is used in production & tests.

PR Close #48521
2022-12-19 19:50:43 +00:00
Andrew Scott fe50813664 feat(common): Add BrowserPlatformLocation to the public API (#48488)
`PlatformLocation` is already part of the public API so developers can
create their own. This means that developers would already be able to
access the existing `BrowserPlatformLocation` at runtime by injecting
it. The motivation for adding `BrowserPlatformLocation` to the public
API is because of those facts, but driven more by the fact that we are
looking to include `MockPlatformLocation` by default in TestBed.
Developers would need a way to revert back to the current behavior for
some tests that rely directly on browser interaction.

PR Close #48488
2022-12-14 09:54:28 -08:00
Andrew Scott ff84c73603 docs(core): Document invalid multi token (#48267)
Add error page for invalid multi token runtime error

PR Close #48267
2022-12-13 14:05:59 -08:00
Matthieu Riegler 279e7d4465 refactor: cleanup polyfills by importing zone.js directly in angular.json (#48380)
Since v15, polyfills can be passed directly into angular.json. Let's use this opportunity to reduce the number of unecessary files.

PR Close #48380
2022-12-13 13:37:08 -08:00
Andrew Scott f58ad86e51 feat(router): Add feature provider for enabling hash navigation (#48301)
The argument against this feature:

Firstly, this isn't a navigation strategy that's very commonly desired.
Secondly, the hash strategy is a location configuration in `@angular/common`
and you can use it outside of the Router or with any custom router implementations.
So while the net effect of using the router is that it updates the URL which is
controlled by the strategy, this feature provider doesn't necessarily need to
exist in the Router. The location strategy is an application-wide configuration
and affects anything that imports `Location`.  Of course, the Router does this
in a few places but plenty of other things might as well.

The argument for this feature:

* Discoverability. While `LocationStrategy` is technically in `@angular/common`, the most
  common use-case _is_ when using it with the Router.
* Precedence in the `RouterModule.forRoot([], {useHash: true})`
* Precedence in other routing libraries (`createWebHashHistory` in VueJS
  and `HashRouter` in React, for example)
* The implementation of `withHashLocation` is much more clear than
  `useHash` was. You can look at the function and see that all it's
  doing is adding the `HashLocationStrategy` to the providers list.

resolves #48295 / #47986

PR Close #48301
2022-12-13 08:28:38 -08:00
Andrew Scott e362214924 fix(common): Fix TestBed.overrideProvider type to include multi (#48424)
TestBed.overrideProvider should include `multi` support in its type. The
underlying implementation already supports it, as documented by the
tests which are currently casting the override to `any` to get around
the bad type.

PR Close #48424
2022-12-12 09:40:22 -08:00
Bob Watson b5bb4c17d0 docs: update of landing page and backup pages (#47047)
Updates the angular.io landing page with new messaging
and new images. The Quick-start app has been updated
to demonstrate a minimalist Angular app and the value
proposition content has been updated.

PR Close #47047
2022-12-09 16:04:34 -08:00
Alan Agius d07241dd12 build: update cross-repo angular dependencies (#48409)
See associated pull request for more information.

Closes: #48339

(cherry picked from commit 31742210a38b3e01e25cfa9c4e13f6f0e13bf1dd)

PR Close #48409
2022-12-09 11:00:58 -08:00
Matthieu Riegler 0fa70dfb6d refactor(router): code cleaning (#48259)
Removing unnecessary type assertions, null assertions etc.

PR Close #48259
2022-12-09 09:59:20 -08:00
Matthieu Riegler 38421578a2 feat(core): Make the isStandalone() function available in public API (#48114)
This commit updates an internal `isStandalone` function and exposes it as a public API,
so that it can be used in applications code.

fixes #47919

PR Close #48114
2022-12-01 13:21:21 -08:00
Andrew Scott 80297348e8 refactor(router): Remove assignExtraOptionsToRouter helper function (#48215)
This commit removes the unnecessary `assignExtraOptionsToRouter` helper
function. This helper is not necessary because the options can be
retrieved from DI and assigned during the construction on the Router.

PR Close #48215
2022-12-01 09:38:26 -08:00
Andrew Scott a0551ee761 refactor(router): Eliminate constructor parameters in Router class (#48215)
The Router constructor and `setupRouter` factory mainly exist as a
legacy configuration. Since the Router's creation, the style in Angular
has evolved quite a bit. This commit eliminates and cleans up some
unnecessary comlicated code paths related to the router
constructor/factory.

Note that there are edits to the `setupTestingRouter` that could be seen
as breaking. However, it is not for several reasons:

1. The function is documented as a factory function. If used as
   documented, the parameters should match what's available in DI
2. The function is totally unused by the Router itself and is not used
   in g3 either. I believe it was made publicApi by an error when
   updating documentation annotations long ago.

PR Close #48215
2022-12-01 09:38:26 -08:00
Andrew Scott d5aaf5523d refactor(router): Remove DeprecatedLoadChildren (#48292)
This option has already been removed from availability externally. Internally, the last use has been removed
for the type on Route.loadChildren. More testing will be necessary to verify nothing relies on the other
code paths.

PR Close #48292
2022-11-30 08:29:11 -08:00
Andrew Scott 6810a04143 refactor(router): Move events subject to transition class (#48202)
The events observable is part of the lifecycle of a navigation. This should
be contained in the NavigationTransitions class rather than the Router.
This Subject is re-exported by the router as an observable to maintain
the public API

PR Close #48202
2022-11-29 14:55:25 -08:00
Alan Agius 612eaca3c5 build: update cross-repo dependencies to latest stable version (#48216)
With this change we update the cross-repo dependencies to the latest stable version

PR Close #48216
2022-11-29 12:29:46 -08:00
Andrew Scott db1c73c431 Revert "refactor(router): Move events subject to transition class (#48202)" (#48269)
This reverts commit f555050f9a.

PR Close #48269
2022-11-28 16:52:07 -08:00
Andrew Scott f555050f9a refactor(router): Move events subject to transition class (#48202)
The events observable is part of the lifecycle of a navigation. This should
be contained in the NavigationTransitions class rather than the Router.
This Subject is re-exported by the router as an observable to maintain
the public API

PR Close #48202
2022-11-28 10:53:26 -08:00
Andrew Scott 228e992db7 docs(router): Deprecate canLoad guards in favor of canMatch (#48180)
As mentioned in #46021, `canMatch` guards can replace `canLoad`. There
are slight differences between the two but the purpose of preventing
user access to feature modules is still achievable. There are several
reasons keeping `CanLoad` around is detrimental to the API surface:

* Lazy loading should not be an architectural feature of an application. It's an
optimization you do for code size. That is, there should not be an architectural
feature in the router to directly specifically control whether to lazy load something or
not based on conditions such as authentication. This slightly
different from the `canMatch` guard: the guard controls whether
you can use the route at all and as a side-effect, whether we download the code.
`CanLoad` only specified whether the code should be downloaded so `canMatch` is
more powerful and more appropriate.

* The naming of `CanLoad` will be potentially misunderstood for the `loadComponent` feature.
Because it applies to `loadChildren`, it feels reasonable to think that it will
also apply to `loadComponent`. This isn’t the case: since we don't need
to load the component until right before activation, we defer the
loading until all guards/resolvers have run.

* Unnecessary API surface bloat where two features (CanMatch and CanLoad) do
essentially the same thing. This affects code size for supporting two
nearly identical features as well as the learning and teaching journey
for them both.

* `CanLoad` guards have the downside of _only_ being run once to prevent
loading child routes. Once that passes and children are loaded, the
guard never runs again. As a result, developers need to always provide
_both_ canLoad and a canActivate in case the answer to the guard flips
back to `false`. This is not the case for `canMatch`, which will run
on every navigation.

DEPRECATED: CanLoad guards in the Router are deprecated. Use CanMatch
instead.

PR Close #48180
2022-11-28 09:04:08 -08:00
Alan Agius 76e861f8de build: update safevalues to 0.4.2 (#48153)
This contains a fix which enabled the ESM version of the package to be consumed.

See: https://github.com/angular/angular/issues/48171#issuecomment-1324728758

PR Close #48153
2022-11-23 09:35:41 -08:00
Bob Watson cc472191a9 docs: update AIO code to v15 (#48153)
PR Close #48153
2022-11-23 09:35:41 -08:00
Andrew Scott 332461bd0c feat(router): Add ability to override onSameUrlNavigation default per-navigation (#48050)
The router providers a configurable `onSameUrlNavigation` value that
allows developers to configure whether navigations to the same URL as
the current one should be processed or ignored. However, this only acts
as a default value and there isn't an API for easily overriding this for
a single navigation. Instead, developers are forced to update the value
of the property on the router instance and remember to reset it.

This feature fills a small gap in the Router APIs that enables
developers to accomplish the task of force reloading a bit easier.

Lengthy discussion about this here: #21115

PR Close #48050
2022-11-22 19:20:33 -08:00
Andrew Scott 6acae1477a feat(core): Add TestBed.runInInjectionContext to help test functions which use inject (#47955)
This commit adds `TestBed.runInInjectionContext` which is equivalent to
`TestBed.inject(EnvironmentInjector).runInContext`. This function will
help make tests for functions which call `inject` from `@angular/core` a
little bit less verbose.

PR Close #47955
2022-11-22 16:53:41 -08:00
Andrew Scott 3c6a439a6f refactor(router): extract navigation transition code to a new file (#48092)
This commit extracts the Router's navigation "transitions" to a separate
file. The goal here is twofold:

- Separate the Router's logic into more manageable chunks. Rather than
  having to always edit a 1000+ line file, this separates different
  pieces into smaller, more focused files
- More importantly, this sets the groundwork for separating the Router
  state from the individual navigation transition. That is, it would be
  good for the rxjs pipeline to _not_ modify the Router state but only
  keep track of its own intermediate stages and emit outwards during
  important events. The Router can subscribe to those events and make
  updates to its state. This would theoretically allow us to swap those
  implementations independently. That is, the Router's state management
  can be changed without changing the transition handling and
  vice-versa.

PR Close #48092
2022-11-22 16:19:44 -08:00
Andrew Scott 73f03ad2d2 feat(router): Add new NavigationSkipped event for ignored navigations (#48024)
The Router currently silently ignores navigations for two reasons:

1. By default, same URL navigations are ignored. When this situation is
   encountered, the navigation is ignored without any events
2. A `UrlHandlingStrategy` may ignore some URLs. For situations when the
   strategy returns `false` for `shouldProcessUrl`, the Router silently
   ignores the URL and updates its internal state without running
   matching, guards, or resolver logic.

This commit adds new `NavigationSkipped` events for the above two situations.

PR Close #48024
2022-11-22 11:34:49 -08:00
Andrew Scott 02fb43a347 Revert "Revert "refactor(router): Simplify router defaults by making the defaults Injectable" (#48121)" (#48135)
This reverts commit 57d9296802. The
original commit was not problematic and was mistakenly reverted.

PR Close #48135
2022-11-21 09:24:00 -08:00
Dylan Hunn 57d9296802 Revert "refactor(router): Simplify router defaults by making the defaults Injectable" (#48121)
This reverts commit 18033d5ed2.

PR Close #48121
2022-11-18 12:16:17 -08:00
Matthieu Riegler b51929a394 fix(router): correct type of nextState parameter in canDeactivate (#48038)
Correct type of nextState parameter in canDeactivate guard to indicate it's never undefined

Fixes #47153

PR Close #48038
2022-11-17 09:35:02 -08:00
Andrew Scott 0a8b8a66cd docs(router): Deprecate public members of Router that are meant to be configured elsewhere (#48006)
None of the public properties of the `Router` are meant to be writeable.
They should all be configured using other methods, all of which have been
documented.

DEPRECATED: router writable properties

The following strategies are meant to be configured by registering the
application strategy in DI via the `providers` in the root `NgModule` or
`bootstrapApplication`:
* `routeReuseStrategy`
* `titleStrategy`
* `urlHandlingStrategy`

The following options are meant to be configured using the options
available in `RouterModule.forRoot` or `provideRouter`.
* `onSameUrlNavigation`
* `paramsInheritanceStrategy`
* `urlUpdateStrategy`
* `canceledNavigationResolution`

The following options are available in `RouterModule.forRoot` but not
available in `provideRouter`:
* `malformedUriErrorHandler` - This was found to not be used anywhere
  internally.
* `errorHandler` - Developers can instead subscribe to `Router.events`
  and filter for `NavigationError`.

PR Close #48006
2022-11-17 09:26:20 -08:00
Andrew Scott 02b18dc5b0 refactor(router): Simplify router defaults by making the defaults Injectable (#48022)
The router has several default strategy implementations that are either
assigned via `new XStrategy()` property assignements or via the factory
function for the `Router` itself. These can be simplified by providing
the default implementation in the strategy `Injectable`. Custom
implementations can still override the defaults by specifying them in
the `providers` list.

Notably, this change also makes the `UrlHandlingStrategy` and
`RouteReuseStrategy` defaults injectable via DI rather than having to
indirectly grab them by going through the `Router` instance and
accessing the properties.

PR Close #48022
2022-11-17 09:25:40 -08:00
ced 804b85554c 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 ec8b52af69 docs(core): add an error details page for unsafe <iframe> bindings (#48027)
PR Close #48027
2022-11-11 11:28:35 -08:00
Andrew Scott 85a932cc80 docs(router): deprecate setupTestingRouter (#48008)
The `setupTestingRouter` function is not necessary. The `Router` can be fully
initialized through the DI configuration in the same way as it is in
production. Tests should use `provideRouter` or `RouterTestingModule`.

PR Close #48008
2022-11-09 11:07:43 -08:00
Andrew Kushnir 2d8d562604 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:56 -08:00
Dylan Hunn 604cdb7307 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
Matthieu Riegler ea3374c16b 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:42 -08:00
Andrew Scott 99898f3370 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
Andrew Scott 6b659d08ef 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 febf29dd51 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:03 -07:00