Commit graph

1997 commits

Author SHA1 Message Date
Andrew Kushnir
0d65e1de2c 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:20 +02:00
WD Snoeijer
6140bae5ce docs: fix linter errors for zone.md (#47707)
PR Close #47707
2022-10-17 12:14:44 +02:00
WD Snoeijer
623e97584c docs: fix linter errors for web-worker.md (#47766)
PR Close #47766
2022-10-17 12:13:40 +02:00
WD Snoeijer
cd25cb2f83 docs: fix linter errors for view-encapsulation.md (#47772)
PR Close #47772
2022-10-17 12:11:52 +02:00
Bob Watson
6c98ca4572 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:25 +00:00
Alex Castle
9483343ebf feat(common): Add fill mode to NgOptimizedImage (#47738)
Add a new boolean attribute to NgOptimizedImage called `fill` which does the following:
* Removes the requirement for height and width
* Adds inline styling to cause the image to fill its containing element
* Adds a default `sizes` value of `100vw` which will cause the image to have a responsive srcset automatically generated

PR Close #47738
2022-10-12 15:56:56 +00:00
WD Snoeijer
547b45a9da docs: fix linter errors for what-is-angular.md (#47708)
PR Close #47708
2022-10-11 23:07:09 +00:00
WD Snoeijer
bbbd4c3ac8 docs: fix linter errors for security.md (#47688)
PR Close #47688
2022-10-11 22:05:43 +00:00
WD Snoeijer
23c06ee83a docs: fix linter errors for workspace-config.md (#47709)
PR Close #47709
2022-10-11 21:59:00 +00:00
WD Snoeijer
5fbe40c2f4 docs: fix linter errors for property-binding-best-practices.md (#47686)
PR Close #47686
2022-10-11 21:19:18 +00:00
WD Snoeijer
83f3d04f24 docs: fix linter errors for property-binding.md (#47687)
PR Close #47687
2022-10-11 21:18:45 +00:00
WD Snoeijer
1818c54b62 docs: fix linter errors in prerendering.md (#47724)
PR Close #47724
2022-10-11 15:59:24 +00:00
Alex Castle
4fde292bb5 feat(common): Add automatic srcset generation to ngOptimizedImage (#47547)
Add a feature to automatically generate the srcset attribute for images using the NgOptimizedImage directive. Uses the 'sizes' attribute to determine the appropriate srcset to generate.

PR Close #47547
2022-10-10 16:21:08 +00:00
Matthias Weiß
bdb5371033 feat(common): add injection token for default DatePipe configuration (#47157)
This commit introduces a new `DATE_PIPE_DEFAULT_OPTIONS` token, which
can be used to configure default DatePipe options, such as date
format and timezone.

DEPRECATED:

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.

PR Close #47157
2022-10-07 09:16:00 -07:00
Mathew Berg
5377e35b53 docs: fix documentation linting errors in ajs-quick-reference.md (#47526)
PR Close #47526
2022-10-06 20:27:26 +00:00
WD Snoeijer
7702a3d4af docs: fix linter errors for lightweight-injection-tokens.md (#47673)
PR Close #47673
2022-10-06 18:10:34 +00:00
WD Snoeijer
5d002df47b docs: fix linter errors for lazy-loading-ngmodules.md (#47645)
Update aio/content/guide/lazy-loading-ngmodules.md

Co-authored-by: Bob Watson <104218420+bob-watson@users.noreply.github.com>

PR Close #47645
2022-10-06 16:50:00 +00:00
WD Snoeijer
fcea8fe377 docs: fix linter errors for libraries.md (#47668)
PR Close #47668
2022-10-06 16:48:39 +00:00
Andrew Kushnir
f73ef21442 feat(router): merge RouterLinkWithHref into RouterLink (#47630)
This commit updates the `RouterLink` to extend the selector to also include `<a>` and `<area>` elements, which were previously matched by the `RouterLinkWithHref` directive. The code of the directives was merged together (since there was a lot of duplication) and this commit finalizes the merge. The `RouterLinkWithHref` becomes an alias of the `RouterLink` directive.

Now there is no need to import and use the `RouterLinkWithHref` class, the `RouterLink` directive will match any element that has the `routerLink` attribute.

DEPRECATED:

The `RouterLinkWithHref` directive is deprecated, use the `RouterLink` directive instead. The `RouterLink` contains the code from the `RouterLinkWithHref` to handle elements with `href` attributes.

PR Close #47630
2022-10-05 15:16:43 -07:00
WD Snoeijer
0035ccfe93 docs: fix linter errors for angular-compiler-options.md page (#47179) (#47618)
fixup! docs: fix linter errors for angular-compiler-options.md page (#47179)

PR Close #47618
2022-10-05 13:43:24 -07:00
Alex Rickabaugh
da58801f95 feat(router): auto-unwrap default exports when lazy loading (#47586)
When using `loadChildren` or `loadComponent`, a common pattern is to pass
a function that returns a `Promise` from a dynamic import:

```typescript
{
  path: 'lazy',
  loadComponent: () => import('./lazy-file').then(m => m.LazyCmp),
}
```

The `.then` part of the expression selects the particular exported
component symbol from the dynamically imported ES module.

ES modules can have a "default export", created with the `export default`
modifier:

```typescript
@Component({...})
export default class LazyCmp { ... }
```

This default export is made available to dynamic imports under the well-
known key of `'default'`, per the ES module spec:
https://tc39.es/ecma262/#table-export-forms-mapping-to-exportentry-records

This commit adds a feature to the router to automatically dereference such
default exports. With this logic, when `export default` is used, a `.then`
operation to select the particular exported symbol is no longer required:

```typescript
{
  path: 'lazy',
  loadComponent: () => import('./lazy-file'),
}
```

The above `loadComponent` operation will automatically use the `default`
export of the `lazy-file` ES module.

This functionality works for `loadChildren` as well.

PR Close #47586
2022-10-04 14:40:58 -07:00
Alex Rickabaugh
e3cef4a784 docs(core): deprecate providedIn: NgModule and providedIn: 'any' (#47616)
This commit deprecates the above two forms of `providedIn`.

DEPRECATED:

- The ability to pass an `NgModule` to the `providedIn` option for
`@Injectable` and `InjectionToken` is now deprecated.

`providedIn: NgModule` was intended to be a tree-shakable alternative to
NgModule providers. It does not have wide usage, and in most cases is used
incorrectly, in circumstances where `providedIn: 'root'` should be
preferred. If providers should truly be scoped to a specific NgModule, use
`NgModule.providers` instead.

- The ability to set `providedIn: 'any'` for an `@Injectable` or
`InjectionToken` is now deprecated.

`providedIn: 'any'` is an option with confusing semantics and is almost
never used apart from a handful of esoteric cases internal to the framework.

PR Close #47616
2022-10-04 11:52:38 -07:00
Dmytro Mezhenskyi
4ba2d3d6b6 docs: add missing link to canMatch guard (#47602)
PR Close #47602
2022-10-03 08:47:27 -07:00
Ciprian Sauliuc
752e2245f4 docs: add oxford commas and rephrase sentences (#47540)
PR Close #47540
2022-09-29 16:41:32 -07:00
Joe Martin (Crowdstaffing)
7809e3a405 docs: Add topics for lifecycle directory (#47392)
Add empty topics to lifecycle directory.

PR Close #47392
2022-09-29 10:51:00 -07:00
Joe Martin (Crowdstaffing)
ee0c7161dd docs: add new files (#47391)
Add new files for component content.

PR Close #47391
2022-09-29 10:50:14 -07:00
Simona Cotin
551c641a64 docs: update broken link (#47532)
PR Close #47532
2022-09-27 10:18:00 -07:00
Ashley Hunter
f9e21d36bd docs: fixing standalone components sample code (#47542)
PR Close #47542
2022-09-26 09:56:57 -07:00
Doug Parker
ddef448cf3 docs: add v15 scheduled release dates (#47513)
These dates are week-specific to give some flexibility during the release process which frequently happens. I back-dated the most recent minors mainly to make sure we include them when we eventually update to v16 and beyond.

PR Close #47513
2022-09-23 14:00:04 -07:00
Bob Watson
53db8ab246 docs: add standalone component intro video (#47359)
Fix: #47358

PR Close #47359
2022-09-19 17:19:09 +02:00
Bob Watson
58e3d79fe6 docs: add link to YouTube video of Typed Forms (#47361)
Fix: #47360

PR Close #47361
2022-09-19 17:12:34 +02:00
Andrew Kushnir
7f637e1873 docs: move Image Directive guide link to the Feature Preview section (#47466)
This commit updates the location of the Image Directive guide link in the left navigation menu. Now the link is located under the Feature Preview section.

Also, this commit updates the Image Directive guides to add a highlighted message that the directive is in the developer preview mode.

PR Close #47466
2022-09-19 09:37:37 +02:00
Benjamin Chanudet
f0f809c561 docs: replace deprecated --outFile option for ng extract-i18n (#47397)
replace deprecated --outFile option for ng extract-i18n

The `--outFile` command option was last used in Angular v10 (back when it was still `ng xi18n`), yet there are still references to it in the documentation, alongside the up-to-date option `--out-file`. This commit replaces all mentions to the incorrect option with the correct writing.
PR Close #47397
2022-09-12 13:25:20 -07:00
Abhishek Rawat
0d4594a53e docs: fix angle brackets in details code block (#47400)
Angle brackets are not showing inside the markdown code block by writing like &lt; &gt;.
PR Close #47400
2022-09-12 13:24:56 -07:00
Andrew Kushnir
ca7bf65933 fix(common): rename rawSrc -> ngSrc in NgOptimizedImage directive (#47362)
As an ongoing effort to stabilize the NgOptimizedImage API before existing the Developer Preview, this commit renames the `rawSrc` attribute used for the NgOptimizedImage selector matching to `ngSrc`. The `rawSrcset` is also renamed to `ngSrcset` for consistency.

The motivation for this change is to align the attribute name better with other built-in directives, such as `ngFor`, `ngIf`, `ngClass`, `ngStyle`, etc.

Note: this is technically a breaking change, but since the NgOptimizedImage directive is in the Developer Preview mode, we land the change in a patch branch.

PR Close #47362
2022-09-09 14:25:37 -07:00
vyom1611
bd66f49261 docs: updates es version based on issue #47335 (#47379)
- Updates the documentation for typescript-configuration.md by updating target version from 'es2017' to 'es2020'

PR Close #47379
2022-09-08 09:33:52 -07:00
Mariia Subkov
6dec750e4b docs: fix linter errors for accessibility page (#47327)
This addresses a part of the issue #47179.

PR Close #47327
2022-09-07 10:49:05 -07:00
Marc Wrobel
eca3db5692 docs(docs-infra): fix minor typos in angular.io (#47295) (#47295)
PR Close #47295

PR Close #47295
2022-09-07 10:47:21 -07:00
Joe Martin (Crowdstaffing)
e810402ffc docs: Update markdown and formatting in image-directive topic. (#47259)
PR Close #47259
2022-09-06 11:30:50 -07:00
George Kalpakas
a0c3326485 fix(service-worker): only consider GET requests as navigation requests (#47263)
Previously, the criteria for determining if a request was a
[navigation request][1] did not account for the request method. This
incorrectly identified HTML form submit POST requests as navigation
requests and served `index.html` instead of passing them through to the
server, thus breaking the form submission.

This commit fixes this by ensuring that only GET requests are considered
navigation requests.

> **Note**
> HTML forms with their method set to `GET` will still be affected by
> the issue. This is not a big concern, because using `GET` for form
> submission is quite uncommon and generally discouraged (due to
> limitations and security considerations).

[1]: https://angular.io/guide/service-worker-config#handling-navigation-requests

Fixes #36368

PR Close #47263
2022-09-06 10:02:10 -07:00
Sabareesh Kappagantu
94ea8700d7 docs: fix linting errors in component overview guide (#47352)
PR Close #47352
2022-09-06 09:41:12 -07:00
Sabareesh Kappagantu
81e41717a3 docs: fix linting errors in class binding guide (#47351)
PR Close #47351
2022-09-06 09:40:39 -07:00
Bingo's Code
99c12c92a8 docs: apply suggestions from code review (#47350)
Co-authored-by: Bob Watson <104218420+bob-watson@users.noreply.github.com>
PR Close #47350
2022-09-06 09:38:31 -07:00
Sabareesh Kappagantu
a053c63f05 docs: fix linting errors in architecture components guide (#47350)
PR Close #47350
2022-09-06 09:38:31 -07:00
Sonu Sindhu
e4f6eed653 docs: formatting issue (#47349)
There were some formatting issue and I just updated * to & in migration-undecorated-classes.md
PR Close #47349
2022-09-06 09:37:48 -07:00
Sabareesh Kappagantu
99be607055 docs: update angular-package-format guide (#47342)
PR Close #47342
2022-09-06 09:35:38 -07:00
Bingo's Code
ce5fc87458 docs: update aio/content/guide/angular-package-format.md with suggestion (#47342)
Co-authored-by: Bob Watson <104218420+bob-watson@users.noreply.github.com>

PR Close #47342
2022-09-06 09:35:38 -07:00
Bingo's Code
ed0c9b6975 docs: apply suggestions from code review (#47342)
adding suggestions from Bob.

Co-authored-by: Bob Watson <104218420+bob-watson@users.noreply.github.com>

PR Close #47342
2022-09-06 09:35:38 -07:00
Sabareesh Kappagantu
ddc2c3db2e docs: fix linting errors in angular package format guide (#47342)
PR Close #47342
2022-09-06 09:35:37 -07:00
Asaf M
ff5ec02904 docs: fix grammar (#47333)
there aren't many forms here, the object model belongs to the form, hence the apostroph is needed before the letter s
PR Close #47333
2022-09-06 09:33:15 -07:00