我如何检测模态内容可见? 我正在尝试为模式内部的元素初始化tinymce。但是在打开模式之前调用了ngAfterViewInit()-因此该元素在页面上仍然不存在。
delayedinit() {
setTimeout(() => { ///<== hack to be sure that textarea already rendered
this.init();
}, 5000);
}
public init() {
tinymce.init({
selector: '#' + this.elementId,
plugins: ['link', 'table'],
skin_url: '../assets/skins/lightgray',
setup: editor => {
this.editor = editor;
editor.on('keyup change', () => {
const content = editor.getContent();
this.onEditorContentChange.emit(content);
});
}
});
}
ngAfterViewInit() {
this.init(); //<==this called when element isn't rendered
}