feat(core/linker): add SimpleChanges type to lifecycle_hooks to simplify OnChanges signature
Closes #8557
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
OnChanges,
|
||||
OnDestroy,
|
||||
SimpleChange,
|
||||
SimpleChanges,
|
||||
Directive,
|
||||
forwardRef,
|
||||
Host,
|
||||
@@ -114,7 +114,7 @@ export class NgControlName extends NgControl implements OnChanges,
|
||||
this.valueAccessor = selectValueAccessor(this, valueAccessors);
|
||||
}
|
||||
|
||||
ngOnChanges(changes: {[key: string]: SimpleChange}) {
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (!this._added) {
|
||||
this.formDirective.addControl(this);
|
||||
this._added = true;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
OnChanges,
|
||||
SimpleChange,
|
||||
SimpleChanges,
|
||||
Directive,
|
||||
forwardRef,
|
||||
Inject,
|
||||
@@ -100,7 +100,7 @@ export class NgFormControl extends NgControl implements OnChanges {
|
||||
this.valueAccessor = selectValueAccessor(this, valueAccessors);
|
||||
}
|
||||
|
||||
ngOnChanges(changes: {[key: string]: SimpleChange}): void {
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (this._isControlChanged(changes)) {
|
||||
setUpControl(this.form, this);
|
||||
this.form.updateValueAndValidity({emitEvent: false});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
SimpleChange,
|
||||
SimpleChanges,
|
||||
OnChanges,
|
||||
Directive,
|
||||
forwardRef,
|
||||
@@ -116,7 +116,7 @@ export class NgFormModel extends ControlContainer implements Form,
|
||||
super();
|
||||
}
|
||||
|
||||
ngOnChanges(changes: {[key: string]: SimpleChange}): void {
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
this._checkFormPresent();
|
||||
if (StringMapWrapper.contains(changes, "form")) {
|
||||
var sync = composeValidators(this._validators);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
OnChanges,
|
||||
SimpleChange,
|
||||
SimpleChanges,
|
||||
Directive,
|
||||
forwardRef,
|
||||
Inject,
|
||||
@@ -72,7 +72,7 @@ export class NgModel extends NgControl implements OnChanges {
|
||||
this.valueAccessor = selectValueAccessor(this, valueAccessors);
|
||||
}
|
||||
|
||||
ngOnChanges(changes: {[key: string]: SimpleChange}) {
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (!this._added) {
|
||||
setUpControl(this._control, this);
|
||||
this._control.updateValueAndValidity({emitEvent: false});
|
||||
|
||||
Reference in New Issue
Block a user