我正在将 ngx-bootstrap 用于 bootstrap 3.3.7,目前正试图让模态服务完全工作。模式对话框打开,但出现的唯一内容是静态内容。我传递给服务的动态内容都不起作用,主要是因为 bsModalRef 似乎没有获取我的组件属性。
这是模态组件:
import { BsModalRef } from 'ngx-bootstrap/modal/modal-options.class';
import { Component } from '@angular/core';
import { CallCenter } from 'app/shared/dsg/models/models';
@Component({
selector: 'dsg-call-centers-dialog',
templateUrl: './call-centers-dialog.component.html',
styleUrls: ['./call-centers-dialog.component.scss']
})
export class CallCentersDialogComponent {
public data: CallCenter[] = [];
constructor(public bsModalRef: BsModalRef) { }
}
然后在我的主机组件中,这是打开对话框的代码片段:
this.bsModalRef = this._modalService.show(CallCentersDialogComponent);
this.bsModalRef.content.data = this.itemData; // Property 'data' does not exist on type 'Object'
所以对话框正在打开,但我的对话框组件的数据属性不可用。
我错过了什么?