我已经导入ngbModal
模块从ng2bootstrap现在我正在尝试打开模态窗口并将当前组件内容加载到模态体中。实施的正确方法是什么?
search.components.ts
import { Component, OnInit,Pipe, PipeTransform, EventEmitter,Input, Output,OnChanges, SimpleChanges } from '@angular/core';
import {GtConfig} from '@angular-generic-table/core';
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
import * as io from 'socket.io-client';
@Component({
selector: 'app-detail',
templateUrl: './detail.component.html',
styleUrls: ['./detail.component.css'],
})
export class DetailComponent implements OnChanges{
constructor(private detailService: DetailService,private ngbModal: NgbModal) {};
ngOnInit(){
this.secondConfigObject = {
settings: this.getBaseSettings(),
fields: this.getBaseFields(),
data: []
};
})
}
rowData(event) {
console.log('Event',event);
this.detailService.changeChart(event);
}
execModal(evt){
const modalReg = this.ngbModal.open(Component);
}
}