docs: invoke signal inputs in adev examples and tutorials

Several adev example and tutorial files read a signal input as a bare
reference (this.foo) instead of invoking it (this.foo()). Because an
InputSignal is a function object, the bare reference is always truthy
and never yields the underlying value, so the surrounding guard or
binding silently did the wrong thing:

- animations open-close(.1/.3): the `!this.logging` guard in
  onAnimationEvent was always false, so the early return never fired.
- form-validation forbidden-name.directive: the `this.forbiddenName`
  ternary condition was always truthy, so validation ran even when no
  forbidden name was configured.
- first-app steps 12 and 14 housing-location: `housingLocation.photo`
  read `.photo` off the signal function (undefined), leaving the
  listing image src empty.

Invoke the signals so the examples reflect correct signal-input usage.

(cherry picked from commit 0d26130a4c)
This commit is contained in:
Kam
2026-07-29 11:32:28 +03:00
committed by Alex Rickabaugh
parent 7be9d5d6b2
commit 420f7c4392
6 changed files with 6 additions and 6 deletions
@@ -57,7 +57,7 @@ export class OpenCloseKeyframeComponent {
logging = input(false);
onAnimationEvent(event: AnimationEvent) {
if (!this.logging) {
if (!this.logging()) {
return;
}
}
@@ -33,7 +33,7 @@ export class OpenCloseBooleanComponent {
logging = input(false);
onAnimationEvent(event: AnimationEvent) {
if (!this.logging) {
if (!this.logging()) {
return;
}
}
@@ -70,7 +70,7 @@ export class OpenClose {
// #docregion events1, events
onAnimationEvent(event: AnimationEvent) {
// #enddocregion events1, events
if (!this.logging) {
if (!this.logging()) {
return;
}
// #docregion events
@@ -34,7 +34,7 @@ export class ForbiddenValidatorDirective implements Validator {
readonly forbiddenName = input<string>('', {alias: 'appForbiddenName'});
validate(control: AbstractControl): ValidationErrors | null {
return this.forbiddenName
return this.forbiddenName()
? forbiddenNameValidator(new RegExp(this.forbiddenName(), 'i'))(control)
: null;
}
@@ -9,7 +9,7 @@ import {RouterLink} from '@angular/router';
<section class="listing">
<img
class="listing-photo"
[src]="housingLocation.photo"
[src]="housingLocation().photo"
alt="Exterior photo of {{ housingLocation().name }}"
crossorigin
/>
@@ -9,7 +9,7 @@ import {RouterLink} from '@angular/router';
<section class="listing">
<img
class="listing-photo"
[src]="housingLocation.photo"
[src]="housingLocation().photo"
alt="Exterior photo of {{ housingLocation().name }}"
crossorigin
/>