Skip to content

docs: fix inaccurate statements and broken examples across adev - #71131

Merged
kirjs merged 1 commit into
angular:mainfrom
GabeSilvaDev:docs/adev-accuracy-fixes
Oct 2, 2026
Merged

kirjs merged 1 commit into
angular:mainfrom
GabeSilvaDev:docs/adev-accuracy-fixes

Conversation

@GabeSilvaDev

@GabeSilvaDev GabeSilvaDev commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

Several adev pages have examples that don't compile or fail at runtime, API names that don't exist, and statements about defaults or behavior that no longer match main. I checked each case against the source, public API goldens, or the CHANGELOG.

Forms, signals and HTTP

  • Fixed examples with a stray | after selector, constructor(): void, an undeclared enable in a custom validator, combineLatest imported from rxjs/operators but subscribed to, map used in an interceptor that returns nothing, a missing BasicInput import, and a fetch result returned as Promise<User> without calling .json().
  • HttpValidatorOptions.options is HttpResourceOptions, so headers and timeout belong in the request object.
  • FormGroupNameDirective and FormArrayNameDirective don't exist; the APIs are FormGroupName and FormArrayName. FieldContext.field and DisabledReason.field were renamed to fieldTree (729b964), and the fetch response property is responseType, not type.
  • resource.value() throws in the 'error' state (Gated Resource API changes #61441); earlyRead receives the cleanup function; submit() doesn't wait for pending validators; an in-progress submission blocks the form and its descendants, not its parents; and with the fetch backend, timeouts are TimeoutError DOMExceptions while network errors are the error thrown by fetch.

Routing, DI and components

  • runInInjectionContext is a standalone function, not an Injector method. The root-level singleton example imported Injectable but used @Service(), and the "class constructor" example tried to read an injected field from a field initializer.
  • NullInjectorError is reported as NG0201. PlatformModule doesn't exist, and platformBrowserDynamic is deprecated.
  • contentChild traverses descendants by default; only contentChildren doesn't. NO_ERRORS_SCHEMA also exists.
  • Fixed router examples with a route pattern that never matches ('user/:id/'), a missing quote in redirectTo, out-of-scope queryParams and id(), an invalid spread inside Routes, an untyped isActive configuration, and an invalid import statement.
  • ActivatedRoute.url emits UrlSegment[]; routerLinkActive doesn't set aria-current without ariaCurrentWhenActive; and unset routerOutletData gives undefined.

Testing, templates and other guides

CLI and reference

  • New projects no longer include @angular/animations, @angular/platform-browser-dynamic, or zone.js when using the default zoneless setup, and use @angular/build. cnpm was removed from packageManager, generated files are app.ts/App, deployUrl is supported by the application builder, and ng generate has no --collection option.
  • Template type checking with strictTemplates is enabled by default. strictTypeChecks doesn't exist; the relevant option is strictNullChecks. Signal inputs were also being read without calling them in the AOT and template type-checking examples.
  • Fixed extended diagnostics examples: NG8111/NG8114 "wrong" examples had been reformatted into the fixed code and are now protected with prettier-ignore; NG8107 referenced fields that don't exist; NG8104's fixed example wasn't valid; and NG02802 used the private withHttpTransferCache.
  • The cli-builder example used options rejected by the application builder, and the optimization example showed stylePreprocessorOptions in the wrong place.

Ecosystem, best practices and tutorials

  • VersionFailedEvent was reverted (Revert "feat(service-worker): notify clients about version failures (… #65087), so the service worker docs now list four events and the example no longer handles VERSION_FAILED. The navigation request mode is navigate.
  • The output interop package is @angular/core/rxjs-interop; rxResource's stream returns an Observable; and OnPush compares inputs with Object.is.
  • Resource status is 'resolved', not 'success'. The a11y example was binding a signal without calling it, the essentials guide imported 'profile-photo.ts', and the tutorial examples had fixes for a missing comma, getHousingLocationById, Array.filter, and the fetch URL.

What is the new behavior?

The examples now compile against main, and the statements match the current source and defaults. The changes are kept minimal; table rows were only realigned where required by Prettier.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Docs-only change in adev/src/content. No lines changed by currently open PRs were touched.

@pullapprove
pullapprove Bot requested a review from josephperrott October 1, 2026 23:07
@angular-robot angular-robot Bot added the area: docs Related to the documentation label Oct 1, 2026
@ngbot ngbot Bot added this to the Backlog milestone Oct 1, 2026
Comment thread adev/src/content/ai/design-patterns.md Outdated
- **Scoped Loading:** place the `resource` in the component that directly uses the data. This helps limit change detection cycles (especially in zoneless applications) and prevents blocking other parts of your application. If data needs to be shared across multiple components, provide the `resource` from a service.
- **SSR and Hydration:** use Server-Side Rendering (SSR) with incremental hydration to render the initial page content quickly. You can show a placeholder for the AI-generated content and defer fetching the data until the component hydrates on the client.
- **Loading State:** use the `resource` `LOADING` [status](guide/signals/resource#resource-status) to show an indicator, like a spinner, while the request is in flight. This status covers both initial loads and reloads.
- **Loading State:** use the `resource` [`isLoading`](guide/signals/resource#resource-status) signal to show an indicator, like a spinner, while the request is in flight. This signal is `true` for both initial loads and reloads.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence was correct. status() reported 'LOADING'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I've reverted that change in 85da381.

@GabeSilvaDev
GabeSilvaDev force-pushed the docs/adev-accuracy-fixes branch from ff8d54e to 85da381 Compare October 1, 2026 23:16
This is the `root` `EnvironmentInjector`.

The `platformBrowserDynamic()` method creates an injector configured by a `PlatformModule`, which contains platform-specific dependencies.
The `bootstrapApplication()` method also creates (or reuses) the platform injector, which contains platform-specific dependencies.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `bootstrapApplication()` method also creates (or reuses) the platform injector, which contains platform-specific dependencies.
The `bootstrapApplication()` function also creates (or reuses) the platform injector, which contains platform-specific dependencies.

@JeanMeche JeanMeche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all those small fixes & improvements !

@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Oct 1, 2026
@JeanMeche
JeanMeche removed the request for review from josephperrott October 1, 2026 23:41
Fix code examples that don't compile or fail at runtime, wrong API
names, and statements of defaults or behavior that no longer match the
source, across the forms, signals, http, routing, DI, components,
testing, CLI, reference, ecosystem and tutorial pages.
@kirjs
kirjs force-pushed the docs/adev-accuracy-fixes branch from 85da381 to 9230181 Compare October 2, 2026 15:06
@angular-robot
angular-robot Bot requested a review from JeanMeche October 2, 2026 15:06
@kirjs
kirjs merged commit 341fadd into angular:main Oct 2, 2026
23 checks passed
@kirjs

kirjs commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: docs Related to the documentation target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants