Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog so complicated #1180

Closed
aminebizid opened this issue Sep 6, 2016 · 4 comments
Closed

Dialog so complicated #1180

aminebizid opened this issue Sep 6, 2016 · 4 comments

Comments

@aminebizid
Copy link

First of all, chapeau bas @jelbourn for writing down this amazing dialog code.
But I don't understand why it's so complicated adding components dynamically with ng2
I think a piece of api like hereafter is missing:
let factory = getFactory(myCmp);
let cmp = factory.createInstance();
this.renderer.addChildComponent(this.htmlElement);

@fxck
Copy link
Contributor

fxck commented Sep 6, 2016

I personally like this API the best ng-bootstrap/ng-bootstrap#3 (comment) (and following discussion)

and it shouldn't even be that hard to make, since I've finally figured out how to use that portal / overlay combo #998 (comment)

@jelbourn
Copy link
Member

jelbourn commented Sep 6, 2016

We feel that a declarative API really doesn't make sense for components like dialog, snackbar, etc.

@Zigzag95 Saying the implementation is "too complicated" is not a bug, feature request, or proposal for Material. It's as complicated as it has to be to support AoT compilation.

@jelbourn jelbourn closed this as completed Sep 6, 2016
@fxck
Copy link
Contributor

fxck commented Sep 6, 2016

@jelbourn I'd argue that for modal particularly it does

a) it's how the native dialog element will work https://developer.mozilla.org/en/docs/Web/HTML/Element/dialog
b) allows you to utilize state managment libs like @ngrx/store better, as it can practically be stateless

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants