从昨天开始,当我尝试为 iO 进行构建时,它不会成功并抛出此错误:
(node:3043) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toLowerCase' of undefined
at /Users/username/Documents/petpo-fe-mobile-bugs/platforms/ios/cordova/lib/list-emulator-build-targets:54:45
at Array.forEach (<anonymous>)
at /Users/username/Documents/petpo-fe-mobile-bugs/platforms/ios/cordova/lib/list-emulator-build-targets:52:44
at Array.reduce (<anonymous>)
at /Users/username/Documents/petpo-fe-mobile-bugs/platforms/ios/cordova/lib/list-emulator-build-targets:50:57
at Array.reduce (<anonymous>)
at /Users/username/Documents/petpo-fe-mobile-bugs/platforms/ios/cordova/lib/list-emulator-build-targets:45:28
at _fulfilled (/Users/username/Documents/petpo-fe-mobile-bugs/platforms/ios/cordova/node_modules/q/q.js:854:54)
at /Users/username/Documents/petpo-fe-mobile-bugs/platforms/ios/cordova/node_modules/q/q.js:883:30
at Promise.promise.promiseDispatch (/Users/username/Documents/petpo-fe-mobile-bugs/platforms/ios/cordova/node_modules/q/q.js:816:13)
(node:3043) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3043) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In …Run Code Online (Sandbox Code Playgroud)我目前正在与 Angular 表单数组作斗争。
我有一个表单,可以在其中动态添加字段。
我已经创建了表单对象:
this.otherDataForm = this.fb.group({
});
Run Code Online (Sandbox Code Playgroud)
我添加这样的动态字段:
addField(field: CustomFormField): void {
this.otherDataForm.addControl(id_campo, new FormControl('', Validators.required));
}
Run Code Online (Sandbox Code Playgroud)
我遍历这些字段:
<form *ngIf="selectedProfile" [formGroup]="otherDataForm">
<div class="mb-3" *ngFor="let field of fields; let i = index">
<label>{{field.descripcion}}</label>
<input class="form-control" [formControlName]="field.id_campo" type="number">
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
但是,如果需要该字段,我似乎无法控制每个字段的错误以显示验证消息。
任何人都可以帮我解决这个问题吗?也许有更好的方法来做到这一点。