Hi guys,
I'm extensively using the library and I love it! Great tool to build the things fast.
However I really miss the way to modularize the modal dialogs (if I follow the steps described here). The current approach is working, but I don't find it too good to use it everywhere in the app because of the following reasons:
overflow: hidden on the parent nodes breaks the layout@ViewChild decorator to get the directive and use it, but this is not the obvious way...onHide / onShow setting up a boolean flag in combination with *ngIf on modal-body element, but again it is not that clean solutionI would really like to have some kind of modal control from the Component side, e.g.
// keep the modal logic and template outside of the consumer component
import { MyModalComponent } from './blabla.component';
@Component(...)
export class MyModalConsumerComponent implements OnInit {
// modal holder which is created once per consumer component
private _modal: Modal;
private _modal_another: Modal;
public ngOnInit() {
// create the modal which content is dynamically resolved from MyModalComponent
this._modal = modalFactory.create(MyModalComponent, ...);
}
public ngOnDestroy() {
this._modal.destroy();
}
public buttonclick() {
this._modal.show();
}
}
I already have an 80% working solution for all the cases above which reuses the components / services you already have, just extends them. If you find that useful I can prepare a pull request
@smnbbrv SUUURE! I would love to see a PR :)
Join slack and we can chat about it, and how we can merge it :)
Any progress on this? Being able to create a modal from within a component would be hugely helpful in many scenarios. Thanks!
Hello @smnbbrv / @valorkin ,
Any progress or update on this as this would greatly help to deal with modal windows in a more cleaner and generic way.
Is it some thing still on your todo list or any WIP, please let us know.
Thanks in advance.
It's part of modal as a service feature
@bhaskerchari I think I won't have time to do that...
@valorkin is this feature under construction?
Yep, polishing AoT right now
closing as a duplicate of https://github.com/valor-software/ng2-bootstrap/issues/579
will be starting to implementing this one
Most helpful comment
Yep, polishing AoT right now