This commit accommodates the recent terminology preference change
from "application" to "app" when describing what an Angular
project produces. For now, using "application" is not a blocker, but
writers should be aware of the change in terminology.
PR Close#48456
With vale 2.21, the spell checker style stopped working.
This commit removes the spell checker from the list of styles to allow Vale to
be used, minus the spell checker, until the bug is resolved or a workaround
can be applied.
PR Close#48456
This commit prepares the documentation directories for future tutorials organized by directory.
Also, it moves the Angular Libraries topic from the Tutorials section to Developer Guides in TOC
PR Close#48162
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
```ts
@NgModule({
imports: [RouterModule.forRoot([{path: '/enigma', component: EnigmaComponent}])],
providers: [{provide: APP_BASE_HREF, useValue: '/en'}]
})
export class AppModule {}
```
Navigating to `/enigma` will redirect to `/en/igma` not to `/en/enigma` as it expects
Fixes: #45744
PR Close#48394
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
There have been/are several bugs related to base href handling in
Angular (#45744, #48175, #19296).
These all stem from the attempted custom handling of base href
in the `Location` class. This logic does not really make an attempt
to be fully compliant with the spec.
PR Close#48422
These migrations can no longer run due to a single update version policy (IE: from 13 to 14, 14 to 15 etc..). Therefore these are redundant and can be deleted.
We also remove the `-beta` suffix from the version which is not needed as the Angular CLI will add the prerelease suffixes automatically.
PR Close#48414
Previously, this check looked like this: `/^(https?:)?\/\//.test(baseHref)`,
but that resulted in syntactically incorrect code after Closure Compiler minification.
This was likely caused by a bug in Closure Compiler, but for now, the check is rewritten
to use `new RegExp` instead.
PR Close#48406
For standalone components it may be beneficial to group multiple declarations
into a single array, that can then be imported all at once in `Component.imports`.
If this array is declared within a library, however, would the AOT compiler
need to extract the contents of the array from the declaration file. This
requires that the array is constructed using an `as const` cast, which results
in a readonly tuple declaration in the generated .d.ts file of the library:
```ts
export declare const DECLARATIONS: readonly [typeof StandaloneDir];
```
The partial evaluator logic did not support this syntax, so this pattern was
not functional when a library is involved. This commit adds the necessary
logic in the static interpreter to evaluate this type at compile time.
Closes#48089
PR Close#48091
Replace custom `flatten` and `map` with native `flatMap` usage.
Benchmark:
| Test case name | Result |
|---------------- |-------------------------------------------------------- |
| flatten & map | flatten & map x 1,182 ops/sec ±2.18% (63 runs sampled) |
| flatMap | flatMap x 6,011 ops/sec ±0.91% (35 runs sampled) |
The fact that `flatMap` is faster is also highlighted in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap
PR Close#48378
When injecting the `ChangeDetectorRef` into a node that matches a component, we create a new ref using the component's LView. This breaks down for host directives, because they run before the component's LView has been created.
These changes resolve the issue by creating the LView before creating the node injector for the directives.
Fixes#48249.
PR Close#48355
refactor(forms): make FormBuilder classes provided in root
This commit updates the FormBuilder classes to provide them in root
instead of using a deprecated pattern of providing a service in a specific
module using the `providedIn` syntax.
Closes#48237.
PR Close#48245
When using the legacy digest algorithm for i18n messages, the output hexadecimal
string now leverages a number's `toString()` function in addition to the `padStart`
string function to generate the result. This removes the need for several helper
functions which involved a series of iteration and bitwise operations to previously
generate the same output.
PR Close#48362
improve the emulated shadowDom implementation so that it can correctly
scope selectors present inside the @container at-rule (recently added
to the css specs)
resolves#48264
PR Close#48353