无法使用angular 4使用ng引导模式获取多参数值
在这里,我创建动态按钮,通过使用按钮值,我将这些值发送到ng引导模式。在这里,我能够发送和检索一个值,但我无法发送多个值,我如何在以下模式的输入中显示它是我的代码: 注意:在这里,我在模式中只获得了Id,但我也发送了名称和Id .html无法使用angular 4使用ng引导模式获取多参数值,angular,typescript,Angular,Typescript,在这里,我创建动态按钮,通过使用按钮值,我将这些值发送到ng引导模式。在这里,我能够发送和检索一个值,但我无法发送多个值,我如何在以下模式的输入中显示它是我的代码: 注意:在这里,我在模式中只获得了Id,但我也发送了名称和Id .html 第二个选项应该是必须作为对象而不是变量处理的选项 const modalRef = this.modalService.open(content); modalRef.componentInstance.data= data; modalRef.result.
第二个选项应该是必须作为对象而不是变量处理的选项
const modalRef = this.modalService.open(content);
modalRef.componentInstance.data= data;
modalRef.result.then((data) => {....
希望能奏效。您只需发送信息即可
<ng-container *ngFor="let info of Data">
<div *ngIf="info.State==='1'" >
<button [id]="info.Id" class="btn btn-outline-secondary" (click)=puchInfo(info)>
{{info.Name}}
</button>
</div>
</ng-container>
然后你可以调用你的函数内部信息
如果有任何查询,请在评论中询问这里我们正在推送数据,但我想在MODALA中打开它推送数据后,您可以使用ng modal并使用内部html显示数据编辑我的回答如果您的内容是字符串,这是不可行的,您需要将内容作为templateRef传递以使其工作。像这样,我必须插入onDriverOne(content,data){const modalRef=this.modalService.open(content);modalRef.componentInstance.data=data;modalRef.result.然后((data)=>{this.closeResult=
Closed with:${result}
},(reason)=>{this.closeResult=dismissrease${this.getDismissReason(reason)}
}); }
const modalRef = this.modalService.open(content);
modalRef.componentInstance.data= data;
modalRef.result.then((data) => {....
<ng-container *ngFor="let info of Data">
<div *ngIf="info.State==='1'" >
<button [id]="info.Id" class="btn btn-outline-secondary" (click)=puchInfo(info)>
{{info.Name}}
</button>
</div>
</ng-container>
infoList=[];
puchInfo(info){
this.infoList.push(info);
}