开发者问题收集
我的html<input name="name" [(ngModel)]="address.name" matInput >和我的ts如下 public address: Address;...ngOnInit() {this.service.getAddress(1).subscribe(address => {this.address = address;});}我的界面看起来像export
我想将 .html 代码中的 [(ngModel)] 分配给一个为空(null 或未定义)的对象,但它给出了错误_co.object 为 null。有两种情况,第一种是我的对象有值,第二种是没有值。第一种情况 ngModel 工作正常,但第二种情况,它给出了为 null 的错误。我尝试使用 elvis(?) 运算符,但没有帮助。问题解决了!!谢谢大家我的 .ts 页面profile: Profil
我在 ionic 3 iOS 应用中使用 cordova-plugin-document-scanner 插件,它允许我使用一些附加功能拍摄照片。一切正常,我在成功回调 (file:///...) 中获得了 fileURI。拍照后,我无法更新 DOM 以在我的视图 home.html 中显示图像。我也尝试更新一个简单的文本(测试),但它也不起作用。我尝试过使用 ngZone 和 ChangeDet
我正在升级到 Angular 6,但运行 ng serve 或 ng build 时似乎出现错误。我确实收到以下错误Cannot destructure property 'createHash' of 'undefined' or 'null'.TypeError: Cannot destructure property 'createHash' of 'undefined' or 'null'
如果最终帖子成功,我有此效果,它会分派一个虚拟操作。@Effect() post$: Observable<Action> = this.actions$.ofType(PropertyActions.UPLOAD_FILE_GETSIGNEDURL).switchMap((action: PropertyActions.UploadFileGetsignedUrl) => {this.actio
请帮忙理解。我正在尝试为反应式表单编写自定义验证器。组件:private form: FormGroup;ngOnInit() {const this_ = this;this.form = new FormGroup({'email': new FormControl(null, [Validators.required, Validators.email]),'password':
我有一个使用动态 ID 生成的表,例如<table><tbody><tr *ngFor="let row of createRange(seats.theatreDimension.rowNum)"><td id={{row}}_{{seat}} *ngFor="let seat of createRange(seats.theatreDimension.seatNumInRow)"></td><
我正在使用来自.NET SPA 服务的 angular 模板。因此,在将 angular 版本 4.1.2 更新到 4.4.6 后,我猜服务器端预渲染正在中断。它给出错误:Microsoft.AspNetCore.NodeServices.HostingModels.NodeInvocationException: Prerendering failed because of error: Typ
我不知道为什么运行 ng serve 时会出现此错误> Class extends value undefined is not a function or null> TypeError: Class extends value undefined is not a function or null> at Object.<anonymous> (/Users/I
我有一个 angular-cli 项目。我想要测试的 html 如下所示:<div *ngIf="!isMobile" class="shop-description">{{ description }}</div><div class="shop-link"><span>{{ link}}</span></div>测试如下所示: beforeEach(() => {fixture = Test
未捕获(在承诺中):TypeError: Cannot read property 'firstChild' of null TypeError: Cannot read property 'firstChild' of null at Object._.og (maps.googleapis.com/maps/api/js?key=&callback=initMap:88:391) at new
刚接触 tinymce,不确定应该将 setContent(this.content) 方法放在哪里。我当前的版本导致我收到错误:TypeError:null 不是对象(评估“body.nodeName”)--- runTask — zone.js:170persona 对象是通过查询我的数据库的服务检索的,该服务运行正常。我在 persona.component.html 中设置了如下实例:<a
我尝试在 Angular 2 中使用 Karma-Jasmine 测试 HTML 单选按钮。我的 HTML 代码如下<label class="color-dark display-block" *ngFor="let userGroup of userGroups">    <input type="radio" id="stateRadio" name="statusRadio(click)=
我正在创建一个 angular2 项目,并使用 ng2-uploader 作为文件上传插件。我想拖放到一个 div 上,同时在 div 内添加一个上传按钮。选择要上传的文件后,我收到错误TypeError:无法将未定义或 null 转换为对象。Html 代码为:<div [hidden]="!onUpload" ngFileDrop [options]="options" (onUpload)="
我正在尝试测试一个在其构造函数中注入了应用程序路由器的服务。根据 Julie Ralph 在 AngularConnect conf 2015 中提出的建议(以及她的存储库:https://github.com/juliemr/ng2-test-seed),我正在使用 Karma 和 Jasmine。它遵循要测试的示例服务:import { Router } from 'angular2/rout