Skip to content

Commit 06a14b9

Browse files
committed
refactor(core): handle angular#24571 todos
1 parent 2c3630a commit 06a14b9

File tree

5 files changed

+5
-23
lines changed

5 files changed

+5
-23
lines changed

packages/common/http/test/jsonp_mock.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ export class MockScriptElement {
2828
}
2929

3030
export class MockDocument {
31-
// TODO(issue/24571): remove '!'.
32-
mock!: MockScriptElement | null;
31+
mock: MockScriptElement | null = null;
3332
readonly body: any = this;
3433

3534
implementation = {
3635
createHTMLDocument: () => new MockDocument(),
3736
};
3837

39-
createElement(tag: 'script'): HTMLScriptElement {
38+
createElement(): HTMLScriptElement {
4039
return new MockScriptElement(this) as any as HTMLScriptElement;
4140
}
4241

packages/forms/src/directives/abstract_form_group_directive.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export class AbstractFormGroupDirective extends ControlContainer implements OnIn
3030
*
3131
* @internal
3232
*/
33-
// TODO(issue/24571): remove '!'.
3433
_parent!: ControlContainer;
3534

3635
/** @nodoc */

packages/forms/src/directives/ng_form.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ export class NgForm extends ControlContainer implements Form, AfterViewInit {
160160
* Possible values: `'change'` | `'blur'` | `'submit'`.
161161
*
162162
*/
163-
// TODO(issue/24571): remove '!'.
164-
@Input('ngFormOptions') options!: {updateOn?: FormHooks};
163+
@Input('ngFormOptions') options?: {updateOn?: FormHooks};
165164

166165
constructor(
167166
@Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator | ValidatorFn)[],

packages/forms/src/directives/ng_model.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ export class NgModel extends NgControl implements OnChanges, OnDestroy {
196196
* @description
197197
* Tracks whether the control is disabled.
198198
*/
199-
// TODO(issue/24571): remove '!'.
200-
@Input('disabled') isDisabled!: boolean;
199+
@Input('disabled') isDisabled?: boolean;
201200

202201
/**
203202
* @description
@@ -221,8 +220,7 @@ export class NgModel extends NgControl implements OnChanges, OnDestroy {
221220
* Defaults to 'change'. Possible values: `'change'` | `'blur'` | `'submit'`.
222221
*
223222
*/
224-
// TODO(issue/24571): remove '!'.
225-
@Input('ngModelOptions') options!: {name?: string; standalone?: boolean; updateOn?: FormHooks};
223+
@Input('ngModelOptions') options?: {name?: string; standalone?: boolean; updateOn?: FormHooks};
226224

227225
/**
228226
* @description

packages/forms/src/directives/select_multiple_control_value_accessor.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,6 @@ function _extractId(valueString: string): string {
4444
return valueString.split(':')[0];
4545
}
4646

47-
/** Mock interface for HTML Options */
48-
interface HTMLOption {
49-
value: string;
50-
selected: boolean;
51-
}
52-
53-
/** Mock interface for HTMLCollection */
54-
abstract class HTMLCollection {
55-
// TODO(issue/24571): remove '!'.
56-
length!: number;
57-
abstract item(_: number): HTMLOption;
58-
}
59-
6047
/**
6148
* @description
6249
* The `ControlValueAccessor` for writing multi-select control values and listening to multi-select

0 commit comments

Comments
 (0)