ngx-bootstrap-modal

Way to add custom class when using ngx-bootstrap modalService

不羁岁月 提交于 2021-02-06 02:37:44
问题 When looking to the ngx-bootstrap source code here: modal-options.class.ts There is an optional class property defined as class?: string; . What is the way to use it ? Is it possible to add a custom class like: this.modalService.config.class = 'myClass'; Before using the servive as for example: this.modalRef = this.modalService.show(template, { animated: false }); This way, I think we can add custom CSS to the displayed modal I've tried to add a custom class without success. That class

Way to add custom class when using ngx-bootstrap modalService

老子叫甜甜 提交于 2021-02-06 02:34:55
问题 When looking to the ngx-bootstrap source code here: modal-options.class.ts There is an optional class property defined as class?: string; . What is the way to use it ? Is it possible to add a custom class like: this.modalService.config.class = 'myClass'; Before using the servive as for example: this.modalRef = this.modalService.show(template, { animated: false }); This way, I think we can add custom CSS to the displayed modal I've tried to add a custom class without success. That class

How pass data from ModalService into component

雨燕双飞 提交于 2019-12-20 05:32:25
问题 I'm trying to use ngx-bootstrap-modal to pass data from a modal service into a modal component. The examples show this: this.modalService.show(ModalContentComponent, {initialState}); But it doesn't show how the ModalContentComponent actually consumes that state. I've played around in a debugger and I never see my component getting that data. How do I access it from the component? 回答1: You can also use the BsModalRef content Like my-modal.component.ts export class MyModalComponent { public

Load self in modal - Angular component

廉价感情. 提交于 2019-12-13 10:31:27
问题 I need to load component in a modal when you access it via it's URL. Need help figuring how that setup should be, I have ngxbootstrap on an angular component and can popup modals in response to e.g.a button click. Can't find anything that shows how entire component template would be loaded in modal when component URL is accessed. Thanks 回答1: You need to have one component for the route, and in it's ngOnInit you can open a modal with the component you want in the modal. To make it reusable,

How pass data from ModalService into component

橙三吉。 提交于 2019-12-02 04:16:40
I'm trying to use ngx-bootstrap-modal to pass data from a modal service into a modal component. The examples show this: this.modalService.show(ModalContentComponent, {initialState}); But it doesn't show how the ModalContentComponent actually consumes that state. I've played around in a debugger and I never see my component getting that data. How do I access it from the component? You can also use the BsModalRef content Like my-modal.component.ts export class MyModalComponent { public myContent; constructor(){} } calling your modal from some other component import { BsModalService, BsModalRef }