Commit Graph

2383 Commits

Author SHA1 Message Date
Matthieu Riegler 7030fb8531 docs: display the exact command to generate a browserslist config (#48879)
`ng generate config browserslist` is the command to generate the browerslist

fixes #48878
PR Close #48879
2023-02-02 09:36:47 -08:00
Matthieu Riegler 8a9907c23a refactor(common): Remove currency pipe depreciation notice about the default currency (#48872)
Currency pipe won't be using the LOCALE_ID to determine the default currency.

fixes #47612

PR Close #48872
2023-02-02 09:30:04 -08:00
Besim Gürbüz 5c5d36547b docs: fix indentation error in content/guide/build.md (#48893)
PR Close #48893
2023-02-02 09:29:16 -08:00
Walid Bouguima 8d3e246dda docs: update Reactive Forms' FormControl usage description (#48858)
It seems that the description of the `FormControl` usage is  incorrect or at least the copy is not very helpful for beginners and can be very confusing as we do not have a command to generate a `FormControl`, as far as I know  😄.  Additionally, the link for component generation points to the CLI page instead of the component generation section on the CLI page. It would be DX/UX for readers and users to get where the link's text is supposed to take them.
PR Close #48858
2023-01-27 16:22:11 +00:00
Virginia Dooley 14aefa1b03 docs: add new files for HTTP content (#47684)
PR Close #47684
2023-01-25 18:29:47 +00:00
Dylan Hunn c03e6a6097 docs: Use of $any() has no runtime incidence. (#48785)
Some users are woried about `$any()` as function calls are to be avoided in templates. This sentence clarifies the situation.

fixes #48781

PR Close #48785
2023-01-24 16:47:33 +00:00
Alan Agius 840530ffd8 docs: update supported Chrome version description (#48782)
- Update Chrome supported version description to match other browsers.
- Updates browserslist configuration in build section to match supported browsers

PR Close #48782
2023-01-20 17:07:53 +00:00
Virginia Dooley 2d0ca73d73 docs: Document extracted from the original Introduction document, which is to be retired. Linting suggested corrections made. Restructuring or rewording sentences to be shorter and clearer. (#47907)
PR Close #47907
2023-01-20 01:21:07 +00:00
Virginia Dooley bca76ed43a docs: Document extracted from the original Introduction document, which is to be retired. Linting suggested corrections made. Restructuring or rewording sentences to be shorter and clearer. (#47906)
docs: Document extracted from the original Introduction document, which is to be retired. Linting suggested corrections made.  Restructuring or rewording sentences to be shorter and clearer.

docs: revised understanding doc and pullapprove.yml

PR Close #47906
2023-01-19 21:32:34 +00:00
Alan Agius 42ca9c0b02 docs: update documentation to use ng generate config and ng generate environments (#48757)
In Angular CLI 15.1  new sub commands to generate configuration and environments files were added. This commit updates several docs to mention these commands.

Closes #48364

PR Close #48757
2023-01-18 10:44:14 -08:00
Andrew Scott fb7b8a95f2 docs: Fix example in breaking changes to apply to correct sentence (#48758)
The "for example..." was supposed to apply to the production code, not the test code sentence.

fixes #48744

PR Close #48758
2023-01-17 09:21:50 -08:00
Andrew Scott 926c35f4ac docs: Deprecate class and InjectionToken and resolvers (#47924)
Class and `InjectionToken`-based guards and resolvers are not as configurable,
are less re-usable, require more boilerplate, cannot be defined inline with the route,
and require more in-depth knowledge of Angular features (`Injectable`/providers).
In short, they're less powerful and more cumbersome.

In addition, continued support increases the API surface which in turn increases
bundle size, code complexity, the learning curve and API surface to teach,
maintenance cost, and cognitive load (needing to grok several different types
of information in a single place).

Lastly, supporting only the `CanXFn` types for guards and `ResolveFn` type
for resolvers in the `Route` interface will enable better code
completion and integration with TypeScript. For example, when writing an
inline functional resolver today, the function is typed as `any` and
does not provide completions for the `ResolveFn` parameters. By
restricting the type to only `ResolveFn`, in the example below
TypeScript would be able to correctly identify the `route` parameter as
`ActivatedRouteSnapshot` and when authoring the inline route, the
language service would be able to autocomplete the function parameters.

```
const userRoute: Route = {
  path: 'user/:id',
  resolve: {
    "user": (route) => inject(UserService).getUser(route.params['id']);
  }
};
```

Importantly, this deprecation only affects the support for class and
`InjectionToken` guards at the `Route` definition. `Injectable` classes
and `InjectionToken` providers are _not_ being deprecated in the general
sense. Functional guards are robust enough to even support the existing
class-based guards through a transform:

```
function mapToCanMatch(providers: Array<Type<{canMatch: CanMatchFn}>>): CanMatchFn[] {
  return providers.map(provider => (...params) => inject(provider).canMatch(...params));
}
const route = {
  path: 'admin',
  canMatch: mapToCanMatch([AdminGuard]),
};
```

With regards to tests, because of the ability to map `Injectable`
classes to guard functions as outlined above, nothing _needs_ to change
if projects prefer testing guards the way they do today. Functional
guards can also be written in a way that's either testable with
`runInContext` or by passing mock implementations of dependencies.
For example:

```
export function myGuardWithMockableDeps(
  dep1 = inject(MyService),
  dep2 = inject(MyService2),
  dep3 = inject(MyService3),
) { }

const route = {
  path: 'admin',
  canActivate: [() => myGuardWithMockableDeps()]
}

// test file
const guardResultWithMockDeps = myGuardWithMockableDeps(mockService1, mockService2, mockService3);
const guardResultWithRealDeps = TestBed.inject(EnvironmentInjector).runInContext(myGuardWithMockableDeps);
```

DEPRECATED: Class and `InjectionToken` guards and resolvers are
deprecated. Instead, write guards as plain JavaScript functions and
inject dependencies with `inject` from `@angular/core`.

PR Close #47924
2023-01-11 15:01:08 -08:00
Andrew Scott 8375a8c9a8 docs: Add heading to the router writable properties deprecation (#48684)
The deprecation note is missing a header. This commit adds one.

PR Close #48684
2023-01-11 14:59:04 -08:00
Jens 01be0e2874 docs: Add support for previous Chrome release (#48669)
Previous Chrome stable version should also be supported
PR Close #48669
2023-01-11 14:57:44 -08:00
Bob Watson 7281dbc913 docs: minor copy edit to suggestion (#48484)
PR Close #48484
2023-01-11 14:56:31 -08:00
Bob Watson 874f197720 docs: minor copy edit to suggestion (#48484)
PR Close #48484
2023-01-11 14:56:31 -08:00
Bob Watson 84285c1ef8 docs: minor copy edit to suggestion (#48484)
PR Close #48484
2023-01-11 14:56:31 -08:00
Bob Watson 1c4eb67354 docs: minor copy edit to suggestion (#48484)
PR Close #48484
2023-01-11 14:56:30 -08:00
Aristeidis Bampakos deb27df160 docs: review router guards section in router guide (#48484)
PR Close #48484
2023-01-11 14:56:30 -08:00
Vladyslav Slipchenko b0318f8b39 docs(docs-infra): fix wording inconsistency of the i18n common prepare section references (#47582)
PR Close #47582
2023-01-11 14:54:08 -08:00
Virginia Dooley 6a009a3e66 docs: Custom data Pipes doc, fixed live-example link. (#48656)
PR Close #48656
2023-01-10 08:08:07 -08:00
Andrew Scott 15eccef4eb docs(router): Clean up error handler deprecations (#48551)
`errorHandler` and `malformedUriErrorHandler` were already deprecated in
the Router class public API. This change updates the deprecation to
extend to `RouterModule.forRoot` configuration options.

PR Close #48551
2023-01-05 14:49:00 -08:00
Andrew Scott 31b94c762f feat(router): Add a withNavigationErrorHandler feature to provideRouter (#48551)
`withNavigationErrorHandler` is a close replacement for the
`RouterModule.forRoot.errorHandler` / `Router.errorHandler`.
It provides a quick, short way for users to define a function to handle
`NavigationError` events.

PR Close #48551
2023-01-05 14:49:00 -08:00
Jens b10e6185de docs: update date from 2022 to 2023 (#48485)
PR Close #48485
2022-12-14 08:43:31 -08:00
Jens ca02f70c25 docs: add planned release schedule till v16 (#48485)
Add release dates for v15.1,v15.2 and v16
PR Close #48485
2022-12-14 08:43:31 -08:00
Bob Watson f6ac94c81c docs: edit suggestion to meet style guide (#47979)
PR Close #47979
2022-12-13 14:47:32 -08:00
lsst25 005e2ba57a docs: add a link to hierarchical-dependency-injection (#47979)
It is not clear that when we provide a service to some eagerly loaded module of an application, then that service is available for components of all eagerly loaded modules of that application. It would be better to give a link for more information at least.
PR Close #47979
2022-12-13 14:47:32 -08:00
Aristeidis Bampakos 5bc502fa2c docs: modify directive composition API guide (#48439)
Add a minor change to indicate the difference from applying a directive in the template.

PR Close #48439
2022-12-12 14:58:17 -08:00
Aristeidis Bampakos 6dd7575d74 docs: fix typo in search keywords guide (#48442)
PR Close #48442
2022-12-12 14:19:58 -08:00
Aristeidis Bampakos cc5b044cbf docs: fix typos in reviewing content guide (#48441)
PR Close #48441
2022-12-12 14:05:36 -08:00
Aristeidis Bampakos bf91f8e8b9 docs: fix style in contributors overview guide (#48440)
PR Close #48440
2022-12-12 14:05:00 -08:00
Bob Watson a6d953e145 docs: move tour of heroes tutorial to a subdirectory (#48162)
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
2022-12-12 12:07:46 -08:00
Virginia Dooley 4d2bac51c2 docs: Document extracted from the original Introduction document, which is to be retired. (#47913)
docs: add to pullapprove

PR Close #47913
2022-12-09 15:06:50 -08:00
Virginia Dooley 528cc457c6 docs: Document extracted from the original Introduction document, which is to be retired. Linting suggested corrections made. Restructuring or rewording sentences to be shorter and clearer. (#47909)
docs: add to pullapprove

PR Close #47909
2022-12-09 14:59:58 -08:00
Virginia Dooley 7ec97f31df docs: Document extracted from the original Introduction document, which is to be retired. Linting suggested corrections made. Restructuring or rewording sentences to be shorter and clearer. (#47912)
PR Close #47912
2022-12-09 14:28:59 -08:00
Virginia Dooley 6d9df7bbf9 docs: Document extracted from the original Introduction document, which is to be retired. Linting suggested corrections made. Restructuring or rewording sentences to be shorter and clearer. (#47908)
docs: add to pullapprove

PR Close #47908
2022-12-09 14:27:56 -08:00
Piotr Kowalski 4d467b32aa docs: fix the name of stub component (#48318)
PR Close #48318
2022-12-07 14:08:25 -08:00
Alan Agius f443ee6af7 docs: wrap json property in double quotes (#48375)
Previously, the `budgets` was not wrapped in quotes which caused the JSON to be invalid.

PR Close #48375
2022-12-06 09:58:21 -08:00
Bob Watson 2b55f4bf0d docs: update docs to use new build and test commands (#48266)
PR Close #48266
2022-11-28 15:33:53 -08:00
Aristeidis Bampakos 379b2702d8 docs: update deployment to GitHub Pages (#48239)
The GitHub Pages section has been moved to the left sidebar of the Settings page.
PR Close #48239
2022-11-28 09:11:00 -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
Derek Cormier 7c8ca113c1 build(bazel): replace ignore example feature with bazel equivalent
Comment out the entry in the EXAMPLES map to ignore an example.
2022-11-22 13:51:16 -07:00
Derek Cormier 9a27c4cb50 build(bazel): incrementally build aio example zips and live examples
The existing scripts were amended to work on one example at a time
2022-11-22 13:51:16 -07:00
Bob Watson 4f03a9c327 docs: fix broken link in v15 deprecations table (#48157)
PR Close #48157
2022-11-22 11:39:47 -08:00
Bob Watson 2e2135bf18 docs: add missing documentation setup instructions (#48174)
PR Close #48174
2022-11-22 11:39:25 -08:00
Alan Agius 57a9f67ae8 docs: fix dates in release guide (#48173)
A version always stays for about a year in LTS.

PR Close #48173
2022-11-22 11:32:01 -08:00
Ivan Rodriguez f376bf8deb docs: fix typo in cli-builder.mf (#48129)
Replace `&commat;example/my-builder` with `@example/my-builder`
PR Close #48129
2022-11-21 13:44:41 -08:00
Joe Roxbury 29b198f0c9 docs(forms): add FormRecord class to API summary (#48136)
Add the missing FormRecord class to the
Reactive forms API summary which is located under Developer Guides ->
Forms -> Reactive Forms.

Fixes #47808

PR Close #48136
2022-11-21 13:44:17 -08:00
Alan Agius 80d0cb5b5b docs: add version 15 to active version (#48148)
With this change we update the releases docs to include version 15 as an active version and mark version 14 as an LTS.

Closes #48116

PR Close #48148
2022-11-21 13:43:45 -08:00
Mikhail Savchuk b653ee340e docs: fix typo in image-directive.md (#48115)
PR Close #48115
2022-11-18 12:17:13 -08:00