Skip to content

Commit e21f91a

Browse files
committed
fix(forms): fix some things that g3 complains about
1 parent aef4b05 commit e21f91a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

packages/forms/signals/src/controls/control.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {
3737
PATTERN,
3838
REQUIRED,
3939
} from '../api/property';
40-
import {Field} from '../api/types';
40+
import type {Field} from '../api/types';
4141
import type {FieldNode} from '../field/node';
4242
import {
4343
illegallyGetComponentInstance,

packages/forms/signals/src/field/context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {Field, FieldContext, FieldPath, FieldState} from '../api/types';
1111
import {FieldPathNode} from '../schema/path_node';
1212
import {isArray} from '../util/type_guards';
1313
import type {FieldNode} from './node';
14-
import {boundPathDepth} from './resolution';
14+
import {getBoundPathDepth} from './resolution';
1515

1616
/**
1717
* `FieldContext` implementation, backed by a `FieldNode`.
@@ -49,7 +49,7 @@ export class FieldNodeContext implements FieldContext<unknown> {
4949
// This ensures that we do not accidentally match on the wrong application of a recursively
5050
// applied schema.
5151
let field: FieldNode | undefined = this.node;
52-
let stepsRemaining = boundPathDepth;
52+
let stepsRemaining = getBoundPathDepth();
5353
while (stepsRemaining > 0 || !field.structure.logic.hasLogic(targetPathNode.root.logic)) {
5454
stepsRemaining--;
5555
field = field.structure.parent;

packages/forms/signals/src/field/resolution.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9+
let boundPathDepth = 0;
10+
911
/**
1012
* The depth of the current path when evaluating a logic function.
1113
* Do not set this directly, it is a context variable managed by `setBoundPathDepthForResolution`.
1214
*/
13-
export let boundPathDepth = 0;
15+
export function getBoundPathDepth() {
16+
return boundPathDepth;
17+
}
1418

1519
/**
1620
* Sets the bound path depth for the duration of the given logic function.

0 commit comments

Comments
 (0)