Commit graph

226 commits

Author SHA1 Message Date
SkyZeroZx
fa430bffb0 docs: add @see links to API docs for better discoverability 2026-01-05 12:12:24 -05:00
SkyZeroZx
bff2dcb93c docs: update forwardRef usage with signals and add HostListener note 2025-12-10 12:23:29 -08:00
SkyZeroZx
0432e76171 docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
Alan Agius
4ed8781301
refactor(core): improve resource loading with async/await
Refactor  to use async/await for clearer asynchronous operations and enhanced error handling.
Simplify resource caching and streamline the resolution of component templates and styles.
Update  in the router to align with the new async resource resolution.
2025-11-11 12:50:16 -08:00
Matthieu Riegler
21ca49cf62 refactor(core): rename ExperimentalIsolatedShadowDom to IsolatedShadowDom
This API is still experimental
2025-11-11 08:46:06 -08:00
Matthieu Riegler
16e61f5dd0 docs(docs-infra): Add support for experimental enum entries 2025-11-11 08:46:06 -08:00
SkyZeroZx
9e4ba3ea71 docs: Fixes DI guide reference missing ')' in see tag (#64457)
PR Close #64457
2025-10-16 17:34:17 +00:00
Matthieu Riegler
69b3c05b9e docs: add mentions host style bindings (#64257)
Also adds a section about css custom properties

fixes #64256

PR Close #64257
2025-10-07 20:39:40 -04:00
Matthieu Riegler
9a16718b13 refactor(core): remove deprecated interpolation option on Components. (#63474)
This option was deprecated by #55778.

BREAKING CHANGE: The `interpolation` option on Components has been removed. Only the default `{{ ... }}` is now supported.

PR Close #63474
2025-09-15 19:35:03 +00:00
Matthieu Riegler
a5e5dbbc16 refactor(core): remove moduleId from Component metadata (#63482)
It was deprecated by #49496 as it had no effect.

BREAKING CHANGE: `moduleId` was removed from `Component` metadata.

PR Close #63482
2025-09-15 18:23:46 +00:00
Alexander Melde
3a3bd364d1 docs: update to new standalone default behavior (#63329)
When declaring directives, the standalone flag is set to true by default in current Angular versions.

The docs for the directive decorator should correctly explain the default behavior, while still mentioning when to set it to false.

PR Close #63329
2025-08-27 11:26:13 -07:00
Ryan Bendel
d24d5742db feat(platform-browser): Add IsolatedShadowDom encapsulation method (#62723)
IsolatedShadowDom encapsulation fixes style leakage in Shadowdom encapsulation by removing sharedstyleshost from dom-renderer IsolatedShadowdom class. Updates docs.

PR Close #62723
2025-08-06 16:48:37 +02:00
Paul Gschwendtner
648bbb097e fix(core): properly recognize failed fetch responses when loading external resources in JIT (#62992)
Currently when loading external resources in JIT, when `fetch` fails,
the `text` is empty and the component is loading. This hides the actual
underlying fetch error. We should properly detect this and error out.

PR Close #62992
2025-08-05 10:10:56 +02:00
Jessica Janiuk
320de4e96d refactor(core): deprecate animations field on component interface (#62895)
This deprecates the animations field on the component decorator in favor of animate.enter and leave.

DEPRECATED: @angular/animations

PR Close #62895
2025-07-30 10:35:29 +00:00
Jeevan Mahesha
9deaa674e6 docs: replace EventEmitter with output and self-closing tags in templates (#60910)
Replaced all instances of EventEmitter with the new output() utility.
Updated templates to use self-closing tags for cleaner markup.

PR Close #60910
2025-04-22 21:42:18 +02:00
Matthieu Riegler
8d31b0065e docs: update docs centered on NgModules (#60933)
PR Close #60933
2025-04-22 11:08:54 +02:00
Vlad Boisa
cc0bd25f3e docs: fix typo in desription (#60261)
Fix typos in description of `styleUrl`

Fixes #60258
PR Close #60261
2025-03-07 10:55:37 -08:00
Samuel Perez
6dd8cce155 docs: fix all brokens links on the API pages (#59162)
This PR fix is for the broken links on the API
pages mentioned in issue #57591.

PR Close #59162
2025-03-04 20:07:23 +00:00
hawkgs
b9155b5121 docs: set syntax highlighting to the remaining Markdown code examples blocks (#59088)
There are some code blocks that slipped through the initial Regex-es.

Related to #59026

PR Close #59088
2025-01-14 15:14:02 -05:00
Alex Rickabaugh
8cea383cc1 refactor(core): remove circular dep in JIT decorator definitions (#59083)
Use `import type` to break phantom circular imports in the runtime
definitions of JIT decorators.

PR Close #59083
2024-12-05 16:01:14 -08:00
hawkgs
b8b6c8c77a refactor(docs-infra): convert code-example-s that have only region param to @example-s (#59004)
Replace all <code-example>-s within TS files that contain only a path and a region with JSDoc @example-s.

PR Close #59004
2024-12-04 18:05:59 +01:00
hawkgs
0513fbc9fc docs: set syntax highlighting of code examples MD code blocks (#59026)
Set the syntax highlighting based on the code examples' language.

PR Close #59026
2024-12-04 17:30:28 +01:00
Joey Perrott
9dbe6fc18b refactor: update license text to point to angular.dev (#57901)
Update license text to point to angular.dev instead of angular.io

PR Close #57901
2024-09-24 15:33:00 +02:00
ChinoUkaegbu
d30cef290d docs(core): update wording in ComponentDecorator (#57878)
PR Close #57878
2024-09-23 11:59:08 +02:00
Alex Rickabaugh
f736bea8ee refactor(core): deprecate @Component.interpolation (#55778)
Angular has long had the ability to use different interpolation delimiters
(by default `{{` and `}}`). This concept was copied over from AngularJS,
where AngularJS syntax is included in HTML sent over the network to the
browser. Occasionally developers would use SSR frameworks which _also_ have
interpolation syntaxes of their own, so there was a need to change the
delimiters used by AngularJS to avoid conflicts.

Since Angular templates are always processed by our compiler and the
interpolation characters are never processed by other systems first, this
option is vestigial in Angular and only increases the complexity of our
parser.

DEPRECATED: `@Component.interpolation` is deprecated. Use Angular's
delimiters instead.

PR Close #55778
2024-05-14 11:48:12 -07:00
Joey Perrott
31fdf0fbea refactor: migrate core to prettier formatting (#55488)
Migrate formatting to prettier for core from clang-format

PR Close #55488
2024-04-29 09:49:19 -07:00
hansi_reit
5eda3bf5f0 docs: add missing usage-notes (#54577)
Fixes #54228

PR Close #54577
2024-04-15 12:25:40 +02:00
Matthieu Riegler
457d02cca3 docs: Use new Urls to drop the docs url mapper (#55043)
PR Close #55043
2024-04-09 12:23:09 -07:00
Matthieu Riegler
f523415203 docs: drop glossary links (#55044)
PR Close #55044
2024-03-28 13:02:50 -07:00
cexbrayat
efdc50a403 docs: view child static query differences formatting (#54370)
The docs were broken as the first line is the only one to be displayed in the table.

PR Close #54370
2024-02-21 15:18:43 -08:00
vatsa03
d8f417bf10 docs(core): fix example sections (#54121)
PR Close #54121
2024-01-31 15:22:30 +00:00
Paul Gschwendtner
77516450c8 refactor(compiler): support JIT for signal-based queries (#54019)
Similar to signal-based inputs, we support signal-based queries in JIT
by expecting a decorator to be added. This is a consequence of the
design, given that JIT requires query declaration information before
the class is initialized- but ironically there is no way to collect this
information without instantiating the class.

A JIT transform in the Angular CLI will automatically generate these
decorators for testing.

PR Close #54019
2024-01-24 16:13:31 +01:00
Andrew Kushnir
a2aa23d8b5 refactor(compiler): add support for internal deferredImports field (#53591)
This commit updates the logic to add support for internal `deferredImports` field in compiler.

PR Close #53591
2024-01-10 15:28:58 -08:00
Paul Gschwendtner
eee0af0599 refactor(core): add internal signal input support for @Input decorator (#53808)
We are adding internal support for declaring signal inputs via the
`@Input` decorator. This is needed for JIT unit testing, or JIT
applications.

In JIT, Angular is not able to recognize signal inputs due to the
lack of static reflection metadata. Decorators attach their information
on the class- without it needing to be instantiated. This allows Angular
to know inputs when preparing/generating the directive definition. With
signal inputs this is not possible- so we need a way to tell Angular
about inputs for JIT applications. We've decided that this is not
something users should have to deal with, so a transform will be added
in a follow-up that will automatically derive/and add the decorators
for signal inputs when requested in JIT environments.

PR Close #53808
2024-01-10 12:21:04 +00:00
Andrew Scott
51ed3b510d refactor(core): Separate application and platform files even more (#53371)
This separates application and platform code into even more files. This now removes
the ciruclar dependency between scheduling and application ref.

PR Close #53371
2023-12-08 14:29:46 -08:00
Andrea Canciani
fc9ba3978c refactor: fix a number of typos throughout the codebase (#52249)
Fix some typos such as `boostrap`, `propery` and more, both in
documentation and in code (comments, identifiers).

PR Close #52249
2023-10-25 16:51:24 -07:00
Sylvain DEDIEU
fdf77b98fc refactor(core): no need for signals property in component interface since inherited from directive (#52039)
Removed the signals property definition from the Component interface since it already exists in the Directive interface and Component inherits from Directive

PR Close #52039
2023-10-19 09:37:57 -07:00
Thabo
add0bd364c docs: correct wording for Directive's decorator host property key description (#51977)
PR Close #51977
2023-10-10 11:22:18 -07:00
Payam Valadkhan
3d06a8133c refactor(core): flatten and resolve ng-module bootstrap info in local compilation mode (#51767)
This change contains runtime logic needed to flatten the NgModule bootstrap field in local compilation mode. While it is quite odd to pass a "nested" array as NgModule bootstrap, it is still required to support this case in local compilation mode since it is supported in full compilation mode.

PR Close #51767
2023-09-18 16:59:55 +02:00
Kristiyan Kostadinov
59387ee476 feat(core): support styles and styleUrl as strings (#51715)
Adds support for passing in `@Component.styles` as a string. Also introduces a new `styleUrl` property on `@Component` for providing a single stylesheet. This is more convenient for the most common case where a component only has one stylesheet associated with it.

PR Close #51715
2023-09-12 13:57:07 -07:00
Matthieu Riegler
83b708203e docs: Improve host binding docs (#51326)
This commit adds the mention of the support of styles/classes/attributes in host bindings.

fixes # 44296

PR Close #51326
2023-08-15 09:54:14 -07:00
Matthieu Riegler
3348f8820b docs: Add precisions about static/dynamic queries. (#51146)
The table is mostly copied from guide/migration-dynamic-flag.

Fixes #51142

PR Close #51146
2023-08-15 09:52:04 -07:00
sunilbaba
bb0f3bc125 docs(docs-infra): Adding required and Transform Args into the usage and documentation of input (#51173)
I# No commands remaining.

PR Close #51173
2023-07-26 10:03:41 -07:00
Matthieu Riegler
daaa0a449b docs: remove trailing periods after @see (#51144)
This fixes a rendering issue where the periods would be bellow the text block.

PR Close #51144
2023-07-24 08:14:51 -07:00
Matthieu Riegler
028bd90bb1 docs(core): Make links out of @see tags (#50110)
This commit is part of the work for #50097 to improve the linking on the online documentation.

PR Close #50110
2023-06-14 10:54:38 +02:00
Kristiyan Kostadinov
68017d4e75 feat(core): add ability to transform input values (#50420)
According to the HTML specification most attributes are defined as strings, however some can be interpreted as different types like booleans or numbers. [In the HTML standard](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes), boolean attributes are considered `true` if they are present on a DOM node and `false` if they are omitted. Common examples of boolean attributes are `disabled` on interactive elements like `<button>` or `checked` on `<input type="checkbox">`. Another example of an attribute that is defined as a string, but interpreted as a different type is the `value` attribute of `<input type="number">` which logs a warning and ignores the value if it can't be parsed as a number.

Historically, authoring Angular inputs that match the native behavior in a type-safe way has been difficult for developers, because Angular interprets all static attributes as strings. While some recent TypeScript versions made this easier by allowing setters and getters to have different types, supporting this pattern still requires a lot of boilerplate and additional properties to be declared. For example, currently developers have to write something like this to have a `disabled` input that behaves like the native one:

```typescript
import {Directive, Input} from '@angular/core';

@Directive({selector: 'mat-checkbox'})
export class MatCheckbox {
  @Input()
  get disabled() {
    return this._disabled;
  }
  set disabled(value: any) {
    this._disabled = typeof value === 'boolean' ? value : (value != null && value !== 'false');
  }
  private _disabled = false;
}
```

This feature aims to address the issue by introducing a `transform` property on inputs. If an input has a `transform` function, any values set through the template will be passed through the function before being assigned to the directive instance. The example from above can be rewritten to the following:

```typescript
import {Directive, Input, booleanAttribute} from '@angular/core';

@Directive({selector: 'mat-checkbox'})
export class MatCheckbox {
  @Input({transform: booleanAttribute}) disabled: boolean = false;
}
```

These changes also add the `booleanAttribute` and `numberAttribute` utilities to `@angular/core` since they're common enough to be useful for most projects.

Fixes #8968.
Fixes #14761.

PR Close #50420
2023-05-30 13:01:13 -07:00
Alex Rickabaugh
9d4842cadb Revert "docs(docs-infra): Remove unused annotation template (#50114)" (#50206)
This reverts commit a1ca162fd6.

This commit causes failures in g3, because `@Annotation` is load-bearing for
tsickle's decorator downleveling transformation.

PR Close #50206
2023-05-08 09:45:35 -07:00
Matthieu Riegler
a1ca162fd6 docs(docs-infra): Remove unused annotation template (#50114)
This page is unused since v7.

PR Close #50114
2023-05-03 10:39:49 +02:00
Andrew Scott
5214df4958 refactor(compiler-cli): Add signals to internal directive metadata (#49981)
This commit adds the `signals: boolean` property to the internal
directive/component metadata. This does not add it to the public API
yet, as the feature has no internal support other than compiler
detection.

PR Close #49981
2023-04-25 15:39:18 -07:00
Matthieu Riegler
d71cde8dab refactor(core): remove ɵmakeDecorator from private exports (#49300)
`makeDecorator` is unused outside of core and is not part of the public API (not exported).

PR Close #49300
2023-04-04 15:10:16 -07:00