parent
9d114c052a
commit
3e26cabe02
|
@ -449,7 +449,8 @@ export abstract class AbstractControl {
|
|||
* @param opts Configuration options that how marking is applied.
|
||||
* * `onlySelf`: When true, mark only this control. When false or not supplied,
|
||||
* marks all direct ancestors, in order to maintain the model.
|
||||
* * `emitEvent`: When false, `statusChanges` and `valueChanges` will not emit an event. Otherwise,
|
||||
* * `emitEvent`: When false, `statusChanges` and `valueChanges` will not emit an event.
|
||||
* Otherwise,
|
||||
* both Observables will emit a status and value event.
|
||||
*/
|
||||
disable(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {
|
||||
|
@ -479,7 +480,8 @@ export abstract class AbstractControl {
|
|||
* @param opts Configure options that happen when marked as untouched
|
||||
* * `onlySelf`: When true, mark only this control. When false or not supplied,
|
||||
* marks all direct ancestors, in order to maintain the model.
|
||||
* * `emitEvent`: When false, `statusChanges` and `valueChanges` will not emit an event. Otherwise,
|
||||
* * `emitEvent`: When false, `statusChanges` and `valueChanges` will not emit an event.
|
||||
* Otherwise,
|
||||
* both Observables will emit a status and value event.
|
||||
*/
|
||||
enable(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {
|
||||
|
@ -533,7 +535,8 @@ export abstract class AbstractControl {
|
|||
* validity checks are applied.
|
||||
* * `onlySelf`: When true, only update this control. When false or not supplied,
|
||||
* update all direct ancestors, in order to maintain the model.
|
||||
* * `emitEvent`: When false, `statusChanges` and `valueChanges` will not emit an event. Otherwise,
|
||||
* * `emitEvent`: When false, `statusChanges` and `valueChanges` will not emit an event.
|
||||
* Otherwise,
|
||||
* both Observables will emit a status and value event.
|
||||
*/
|
||||
updateValueAndValidity(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {
|
||||
|
@ -642,8 +645,10 @@ export abstract class AbstractControl {
|
|||
* Reports error data for a specific error occurring in this control or in another control.
|
||||
*
|
||||
* @param errorCode The error code for which to retrieve data
|
||||
* @param path The path to a control to check. If not supplied, checks for the error in this control.
|
||||
* @returns The error data if the control with the given path has the given error, otherwise null or undefined.
|
||||
* @param path The path to a control to check. If not supplied, checks for the error in this
|
||||
* control.
|
||||
* @returns The error data if the control with the given path has the given error, otherwise null
|
||||
* or undefined.
|
||||
*/
|
||||
getError(errorCode: string, path?: string[]): any {
|
||||
const control = path ? this.get(path) : this;
|
||||
|
@ -655,7 +660,8 @@ export abstract class AbstractControl {
|
|||
* Reports whether the control with the given path has the error specified.
|
||||
*
|
||||
* @param errorCode The error code for which to retrieve data
|
||||
* @param path The path to a control to check. If not supplied, checks for the error in this control.
|
||||
* @param path The path to a control to check. If not supplied, checks for the error in this
|
||||
* control.
|
||||
* @returns True when the control with the given path has the error, otherwise false.
|
||||
*/
|
||||
hasError(errorCode: string, path?: string[]): boolean { return !!this.getError(errorCode, path); }
|
||||
|
@ -909,12 +915,16 @@ export class FormControl extends AbstractControl {
|
|||
*
|
||||
* @param value The new value for the control.
|
||||
* @param options Configuration options for how the control emits events when the value changes.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
|
||||
* updateValueAndValidity} method.
|
||||
*
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is false.
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
|
||||
* false.
|
||||
* * `emitEvent`: When true (the default), each change triggers a valueChanges event.
|
||||
* * `emitModelToViewChange`: When true (the default), each change triggers an `onChange` event to update the view.
|
||||
* * `emitViewToModelChange`: When true (the default), each change triggers an `ngModelChange` event to update the model.
|
||||
* * `emitModelToViewChange`: When true (the default), each change triggers an `onChange` event to
|
||||
* update the view.
|
||||
* * `emitViewToModelChange`: When true (the default), each change triggers an `ngModelChange`
|
||||
* event to update the model.
|
||||
*
|
||||
*/
|
||||
setValue(value: any, options: {
|
||||
|
@ -966,7 +976,8 @@ export class FormControl extends AbstractControl {
|
|||
*
|
||||
* @param options Configuration options for emitting events when the control value changes.
|
||||
*
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is false.
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
|
||||
* false.
|
||||
* * `emitEvent`: When true (the default), each change triggers a valueChanges event.
|
||||
*
|
||||
*/
|
||||
|
@ -1247,9 +1258,11 @@ export class FormGroup extends AbstractControl {
|
|||
*
|
||||
* @param value The new value for the control that matches the structure of the group.
|
||||
* @param options Configuration options for how the control emits events when the value changes.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
|
||||
* updateValueAndValidity} method.
|
||||
*
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is false.
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
|
||||
* false.
|
||||
* * `emitEvent`: When true (the default), each change triggers a valueChanges event.
|
||||
*/
|
||||
setValue(value: {[key: string]: any}, options: {onlySelf?: boolean, emitEvent?: boolean} = {}):
|
||||
|
@ -1286,9 +1299,11 @@ export class FormGroup extends AbstractControl {
|
|||
*
|
||||
* @param value The object that matches the structure of the group
|
||||
* @param options Configure options that happen when the value is patched
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is false.
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
|
||||
* false.
|
||||
* * `emitEvent`: When true (the default), each change triggers a valueChanges event.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
|
||||
* updateValueAndValidity} method.
|
||||
*/
|
||||
patchValue(value: {[key: string]: any}, options: {onlySelf?: boolean, emitEvent?: boolean} = {}):
|
||||
void {
|
||||
|
@ -1318,9 +1333,11 @@ export class FormGroup extends AbstractControl {
|
|||
* and options for handling updates and validation.
|
||||
*
|
||||
* @param options Configuration options that happen when the group is reset.
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is false.
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
|
||||
* false.
|
||||
* * `emitEvent`: When true (the default), each change triggers a valueChanges event.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
|
||||
* updateValueAndValidity} method.
|
||||
*
|
||||
* @usageNotes
|
||||
*
|
||||
|
@ -1659,9 +1676,11 @@ export class FormArray extends AbstractControl {
|
|||
* @param value Array of values for the controls
|
||||
* @param options Configure options for emitting events when the control value changes
|
||||
*
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is false.
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
|
||||
* false.
|
||||
* * `emitEvent`: When true (the default), each change triggers a valueChanges event.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
|
||||
* updateValueAndValidity} method.
|
||||
*/
|
||||
setValue(value: any[], options: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {
|
||||
this._checkAllValuesPresent(value);
|
||||
|
@ -1696,9 +1715,11 @@ export class FormArray extends AbstractControl {
|
|||
* @param value Array of latest values for the controls
|
||||
* @param options Configure options for emitting events when the control value changes
|
||||
*
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is false.
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
|
||||
* false.
|
||||
* * `emitEvent`: When true (the default), each change triggers a valueChanges event.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
|
||||
* updateValueAndValidity} method.
|
||||
*/
|
||||
patchValue(value: any[], options: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {
|
||||
value.forEach((newValue: any, index: number) => {
|
||||
|
@ -1748,9 +1769,11 @@ export class FormArray extends AbstractControl {
|
|||
* @param value Array of values for the controls
|
||||
* @param options Configure options for emitting events when the control value changes
|
||||
*
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is false.
|
||||
* * `onlySelf`: When true, each change only affects this control, and not its parent. Default is
|
||||
* false.
|
||||
* * `emitEvent`: When true (the default), each change triggers a valueChanges event.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method.
|
||||
* The configuration options are passed to the {@link AbstractControl#updateValueAndValidity
|
||||
* updateValueAndValidity} method.
|
||||
*/
|
||||
reset(value: any = [], options: {onlySelf?: boolean, emitEvent?: boolean} = {}): void {
|
||||
this._forEachChild((control: AbstractControl, index: number) => {
|
||||
|
|
Loading…
Reference in New Issue