【发布时间】:2019-09-16 18:42:21
【问题描述】:
我有一个非常小众的用例。我必须添加这样的模态动画: regular css animation 但是我需要在所述模态中有一个组件(我们自己的数据表过滤器组件)。 所以我需要使用 ModalService。但是这个服务只是像这样附加我的自定义配置:
toggleFilter = () => {
const modalOptions: ModalOptions = {
initialState: {
labels: this.datatableLabels, // needed for filter to have labels
filterGroups: this.filterGroups // needed to add filterGroups
},
class: 'filter-modal' // this sould be my custom class
};
this.bsModalRef = this.modalService.show(FilterComponent, modalOptions);
}
到modal-content,上面提到的动画和样式使用了上面的div。不仅当封装设置为ViewEncapsulation.None 时它可以工作,而且它也会破坏我们的其他模态,因为我无法将正确的类应用于我需要处理的类。
我该如何克服我遇到的这个问题?
【问题讨论】:
-
尝试通过定位组件选择器来添加 css。可能是设置 ViewEncapsulation.None 时不会影响其他模块。
标签: css angular bootstrap-modal ngx-bootstrap