Git Product home page Git Product logo

Comments (10)

sir-dunxalot avatar sir-dunxalot commented on June 8, 2024

It's a very good point. This addon is going to be updated to work almost exclusively with components and a service but I'm waiting to see what routable component looks like first. There will be some small updates before then (for example the modal controller becoming a service). The service would be easy to inject into components.

Do you think that would be sufficient to solve this issue?

from ember-modals.

optikalefx avatar optikalefx commented on June 8, 2024

That would be perfect. I have other injected services already, and that was the path I'll have to go down if you weren't going to make it that. I don't have experience making a service though, so it would probably take me way longer.

from ember-modals.

sir-dunxalot avatar sir-dunxalot commented on June 8, 2024

Ok, not a problem. I think I'll get the first couple of changes released within a week and a half or two weeks. Does that fit with your time frame? And are you able to create a workaround in the meantime?

from ember-modals.

sir-dunxalot avatar sir-dunxalot commented on June 8, 2024

If not, this.get('targetObject').showModal('some-template-name') should work just fine in a component.

from ember-modals.

optikalefx avatar optikalefx commented on June 8, 2024

Yea, for now i've bubbled actions up to parent controllers using this.sendAction. this.get() doesn't make sense here b/c you can't do this.get('controller:index') or whatever. At least not that i'm aware of

from ember-modals.

sir-dunxalot avatar sir-dunxalot commented on June 8, 2024

Ok. If your component is in the template of a route (i.e. templates/index.hbs contains the component you want to call a modal from I believe targetObject will work here - that references the context that the component's template is rendered in. But either way, it seems like you're got a temporary fix. I'll try to expedite the service refactor.

from ember-modals.

optikalefx avatar optikalefx commented on June 8, 2024

OH you mean literally right "targetObject'. Ha. I'll give that a shot

from ember-modals.

optikalefx avatar optikalefx commented on June 8, 2024

So that works as long as the component is not inside another component. Which it is in my case. So I'll keep the bubbling for the time being. Let me know when you want some testing. Thanks!

from ember-modals.

sir-dunxalot avatar sir-dunxalot commented on June 8, 2024

Ok, good to know! And will do - thanks!

from ember-modals.

sir-dunxalot avatar sir-dunxalot commented on June 8, 2024

This has been fixed with the rewrite in #28

from ember-modals.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.