- Notifications
You must be signed in to change notification settings - Fork27.1k
refactor(forms): remove unused and duplicate code#66186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
ɵɵproperty to reduce duplicate codeReuse `ɵɵproperty` to implement `ɵɵcontrol` instead of duplicating itsimplementation.
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -9,7 +9,6 @@ import {RuntimeError, RuntimeErrorCode} from '../../errors'; | ||
| import {performanceMarkFeature} from '../../util/performance'; | ||
| import {getClosureSafeProperty} from '../../util/property'; | ||
| import {assertFirstCreatePass} from '../assert'; | ||
| import {ɵCONTROL, ɵControl, ɵFieldState} from '../interfaces/control'; | ||
| import {DirectiveDef} from '../interfaces/definition'; | ||
| import {InputFlags} from '../interfaces/input_flags'; | ||
| @@ -34,7 +33,7 @@ import {debugStringifyTypeForError} from '../util/stringify_utils'; | ||
| import {getNativeByTNode, storeCleanupWithContext} from '../util/view_utils'; | ||
| import {listenToOutput} from '../view/directive_outputs'; | ||
| import {listenToDomEvent, wrapListener} from '../view/listeners'; | ||
| import {ɵɵproperty} from './property'; | ||
| import {writeToDirectiveInput} from './write_to_directive_input'; | ||
| /** | ||
| @@ -87,21 +86,14 @@ export function ɵɵcontrolCreate(): void { | ||
| * @codeGenApi | ||
| */ | ||
| export function ɵɵcontrol<T>(value: T, sanitizer?: SanitizerFn | null): void { | ||
| ɵɵproperty('field', value, sanitizer); | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. At least in the past we had this rule about not having instructions calling other instructions directly, it's why we have the | ||
| ɵcontrolUpdate(); | ||
| } | ||
| /** | ||
| * Updates the form control properties of a `field` bound form control. | ||
| * | ||
| * Does nothing if the current node is not a `field` bound form control. | ||
| * | ||
| * NOTE: This instruction exists solely to accommodate tree-shakeable, dynamic control bindings. | ||
| * It's intended to be referenced exclusively by the Signal Forms `Field` directive and should not | ||
| @@ -110,18 +102,6 @@ export function ɵɵcontrol<T>(value: T, sanitizer?: SanitizerFn | null): void { | ||
| export function ɵcontrolUpdate(): void { | ||
| const lView = getLView(); | ||
| const tNode = getSelectedTNode(); | ||
| const control = getControlDirective(tNode, lView); | ||
| if (control) { | ||
| updateControlClasses(lView, tNode, control); | ||