【发布时间】:2021-01-05 05:40:57
【问题描述】:
我需要将组件名称作为参数传递给函数并接收并使用它。但只收到字符串。下面是代码
(click)="this.myapp.openModal('AddContactModelComponent','xl')"
我在这里收到它作为组件使用
openModal(component:any,size:string) {
// const modalRef = this.modalService.open(ModalComponent);
const modalRef = this.modalService.open(
component,
{
size: size,
});
this.modal_title ='test';
}
【问题讨论】:
标签: angular arguments components