(parent: any, isGroup: boolean, key: string | number)
| 265 | } |
| 266 | |
| 267 | export function assertControlPresent(parent: any, isGroup: boolean, key: string | number): void { |
| 268 | const controls = parent.controls as {[key: string | number]: AbstractControl<any>}; |
| 269 | const collection = isGroup ? Object.keys(controls) : controls; |
| 270 | if (!collection.length) { |
| 271 | throw new RuntimeError( |
| 272 | RuntimeErrorCode.NO_CONTROLS, |
| 273 | typeof ngDevMode === 'undefined' || ngDevMode ? noControlsError(isGroup) : '', |
| 274 | ); |
| 275 | } |
| 276 | if (!hasOwnControl(controls, key)) { |
| 277 | throw new RuntimeError( |
| 278 | RuntimeErrorCode.MISSING_CONTROL, |
| 279 | typeof ngDevMode === 'undefined' || ngDevMode ? missingControlError(isGroup, key) : '', |
| 280 | ); |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | export function assertAllValuesPresent(control: any, isGroup: boolean, value: any): void { |
| 285 | control._forEachChild((_: unknown, key: string | number) => { |
no test coverage detected
searching dependent graphs…