Comments (10)
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.
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.
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.
If not, this.get('targetObject').showModal('some-template-name')
should work just fine in a component.
from ember-modals.
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.
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.
OH you mean literally right "targetObject'. Ha. I'll give that a shot
from ember-modals.
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.
Ok, good to know! And will do - thanks!
from ember-modals.
This has been fixed with the rewrite in #28
from ember-modals.
Related Issues (15)
- Passing no argument to `showModal()` should throw a user-friendly error HOT 1
- Modal closing is not animated HOT 6
- modal controller should extend Em.Controller, not Em.ObjectController HOT 3
- Clicking overlay on iPhone
- Test suite HOT 1
- Close modal being used in place of hide HOT 1
- Add `tmp` dir to the .npmignore. HOT 1
- Docs are wrong for modal close HOT 2
- Question about ember-modals on IE8 / plans for supporting Ember 1.13 HOT 6
- _actions: is deprecated in ember 2 HOT 1
- no action handler for: closeModal HOT 4
- Application route mixin not found HOT 5
- Firefox doesn't transition box shadow HOT 1
- Clicking on the overlay should close the modal by default. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-modals.