|
6 | 6 | * found in the LICENSE file at https://angular.io/license |
7 | 7 | */ |
8 | 8 |
|
9 | | -import {setActiveConsumer} from '@angular/core/primitives/signals'; |
| 9 | +import {setActiveConsumer, SIGNAL} from '@angular/core/primitives/signals'; |
10 | 10 |
|
| 11 | +import {InputSignal} from '../../authoring'; |
| 12 | +import {InputSignalNode} from '../../authoring/input_signal_node'; |
11 | 13 | import {Injector} from '../../di/injector'; |
12 | 14 | import {ErrorHandler} from '../../error_handler'; |
13 | 15 | import {RuntimeError, RuntimeErrorCode} from '../../errors'; |
@@ -39,7 +41,7 @@ import {RComment, RElement, RNode, RText} from '../interfaces/renderer_dom'; |
39 | 41 | import {SanitizerFn} from '../interfaces/sanitization'; |
40 | 42 | import {TStylingRange} from '../interfaces/styling'; |
41 | 43 | import {isComponentDef, isComponentHost, isContentQueryHost} from '../interfaces/type_checks'; |
42 | | -import {CHILD_HEAD, CHILD_TAIL, CLEANUP, CONTEXT, DECLARATION_COMPONENT_VIEW, DECLARATION_VIEW, EMBEDDED_VIEW_INJECTOR, ENVIRONMENT, FLAGS, HEADER_OFFSET, HOST, HostBindingOpCodes, HYDRATION, ID, INJECTOR, LView, LViewEnvironment, LViewFlags, NEXT, PARENT, REACTIVE_TEMPLATE_CONSUMER, RENDERER, T_HOST, TData, TVIEW, TView, TViewType} from '../interfaces/view'; |
| 44 | +import {CHILD_HEAD, CHILD_TAIL, CLEANUP, CONTEXT, DECLARATION_COMPONENT_VIEW, DECLARATION_VIEW, EMBEDDED_VIEW_INJECTOR, ENVIRONMENT, FLAGS, HEADER_OFFSET, HOST, HostBindingOpCodes, HYDRATION, ID, INJECTOR, LView, LViewEnvironment, LViewFlags, NEXT, PARENT, RENDERER, T_HOST, TData, TVIEW, TView, TViewType} from '../interfaces/view'; |
43 | 45 | import {assertPureTNodeType, assertTNodeType} from '../node_assert'; |
44 | 46 | import {clearElementContents, updateTextNode} from '../node_manipulation'; |
45 | 47 | import {isInlineTemplate, isNodeMatchingSelectorList} from '../node_selector_matcher'; |
@@ -1304,7 +1306,16 @@ function writeToDirectiveInput<T>( |
1304 | 1306 | if (def.setInput !== null) { |
1305 | 1307 | def.setInput(instance, value, publicName, privateName); |
1306 | 1308 | } else { |
1307 | | - (instance as any)[privateName] = value; |
| 1309 | + // TODO: temporary hack for development testing |
| 1310 | + if ((instance as any)[privateName]?.[SIGNAL] !== undefined && |
| 1311 | + (instance as any)[privateName]?.constructor?.name === 'InputSignal') { |
| 1312 | + const node = |
| 1313 | + (((instance as any)[privateName] as InputSignal<unknown, unknown>)[SIGNAL] as |
| 1314 | + InputSignalNode<unknown, unknown>); |
| 1315 | + node.applyValueToInputSignal(node, value); |
| 1316 | + } else { |
| 1317 | + (instance as any)[privateName] = value; |
| 1318 | + } |
1308 | 1319 | } |
1309 | 1320 | } finally { |
1310 | 1321 | setActiveConsumer(prevConsumer); |
|
0 commit comments