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

Modal Service - pass over parameters when opening component as content #433

Closed
ignipae opened this issue Jan 21, 2019 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request
Projects

Comments

@ignipae
Copy link

ignipae commented Jan 21, 2019

Is this a bug, enhancement, or feature request?

Feature request

Briefly describe your proposal.

As of now, it is not possible to pass over parameters to the modal service, when opening a component as content.
This is a common concept in other frameworks, when it comes to outsource modals into components.

Let's assume, I have a modal which requires specific parameters to render properly and to make sense. For example an edit modal, which should already have data provided.
I would have to do something like this:
let modalRef = modalService.open(ModalComponent);
modalRef.instance.parameterA = "valueA";
modalRef.instance.parameterB = "valueB";

Instead I would like to do it in that way:
modalService.open(ModalComponent, {parameterA: "valueA", parameterB: "valueB"});

Which versions of Angular and Fundamental NGX are affected? (If this is a feature request, use current version.)

Current version

Is there anything else we should know?

If you agree with this proposal, I can also do a pull request for that.

@droshev
Copy link
Contributor

droshev commented Jan 21, 2019

hi @ignipae, thanks for playing with the library. Go ahead and open a PR if you already explored this issue. Would you mind even adding an example on the modal's playground page? It would be useful for other developers to have a snippet.

@droshev droshev added enhancement New feature or request MVP1 labels Jan 21, 2019
@MattL75
Copy link
Contributor

MattL75 commented Jan 21, 2019

Yeah Angular Material implements this. How about just adding a data object that is then passed over? What do you think @mikerodonnell89 ? Should be a pretty quick PR.

Alternatively, if you want to open a PR @ignipae feel free, we'll use all the help we can get!

ignipae added a commit to ignipae/fundamental-ngx that referenced this issue Jan 21, 2019
* updated the component as modal documentation code example
@mikerodonnell89 mikerodonnell89 self-assigned this Jan 22, 2019
mikerodonnell89 added a commit that referenced this issue Jan 23, 2019
* updated the component as modal documentation code example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
board
  
Awaiting triage
Development

No branches or pull requests

4 participants