-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(angular/input): support signal-based input accessor (#2394)
Expands the `SBB_INPUT_VALUE_ACCESSOR` to support a signal-based accessor.
- Loading branch information
Showing
2 changed files
with
34 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { InjectionToken } from '@angular/core'; | ||
import { InjectionToken, WritableSignal } from '@angular/core'; | ||
|
||
/** | ||
* This token is used to inject the object whose value should be set into `InputDirective`. | ||
* If none is provided, the native `HTMLInputElement` is used. Directives can provide | ||
* themselves for this token, in order to make `InputDirective` delegate the getting and setting of the | ||
* value to them. | ||
*/ | ||
export const SBB_INPUT_VALUE_ACCESSOR = new InjectionToken<{ value: any }>( | ||
export const SBB_INPUT_VALUE_ACCESSOR = new InjectionToken<{ value: any | WritableSignal<any> }>( | ||
'SBB_INPUT_VALUE_ACCESSOR', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters