Open joshpfosi opened 9 years ago
@joshpfosi Hey,
To be honest I'm not really sure, if you have complete example I can try to debug it,
But in general, the idea is that since the toggler is not a descendant view of the modal it will search in Ember views for the view with the name as mentioned in the 'modal-id' param.
Make sure that:
1) when u create the toggler u've put modal-id='the-modal-id'
and of course assigned an id to the modal,
2) Try to debug what is the value of Em.View.views[this.get('modal-id')]
, it should resolve to the modal view.
Thanks!
Hmm, stepping through modal-id
is defined properly. I couldn't reproduce this in an independent app which makes me think its something wrong with my setup. I'll look into it more.
So by couldn't I meant could... Here's a repository that demonstrates the issue.
https://github.com/joshpfosi/ember-idx-modal-issue-12
Clone it, run ember server
, and open localhost:4200/tests
and you should get a failure on the Landing Page integration test.
I am trying to do some integration testing of your modal, and any page I load with a modal on it triggers this exception:
I narrowed it down (I think) to
modal-toggler.js
, line 61:return this.set('modal', Em.View.views[this.get('modal-id')]);
in the function below. Putting a break point there immediately raises the exception. This doesn't appear in production or development only QUnit, which makes me think it has something to do with the test env specifically.