-
Notifications
You must be signed in to change notification settings - Fork 138
Closed
Description
The Angular team introduced signals but more importantly, signal inputs with Version 18.
The problem with the new signals is that they act as functions, which UI-Router doesn't seem to handle.
Example
@Component({
selector: 'app-some',
standalone: true,
imports: [CommonModule],
template: `{{ someInput() }}`,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SomeComponent {
readonly someInput = input<string>(null);
}const states: Ng2StateDeclaration[] = [
{
name: 'some-state',
url: '/some',
component: SomeComponent,
resolve: {
someInput: [async () => await of('Resolved value').toPromise()],
},
},
];Expected behavior
- UI-Router should resolve the
someInputresolvable - The resolved value should be set for the signal input using
someInput.set(value) - The input in the component should still be a usable signal input (access to
someInput(),someInput.set(...),someInput.update(...), etc...)
Actual behavior
- UI-Router resolves the value correctly
- The resolved value is then set as a raw value, overriding the signal input (and making it a plain string in this example)
- The signal input can no longer be used as intended (using
someInput()in the component would throw[...] is not a functionwhen navigated to)
mokipedia
Metadata
Metadata
Assignees
Labels
No labels