You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 16, 2021. It is now read-only.
I'm trying to use ember-touch with the latest master and I'm getting the error Uncaught TypeError: Cannot call method 'lookup' of undefined which is coming from:
I think, you are not using the router, aren't you?
With the current implementation, you have to pass the application container to the view, which is something done automatically when using ember-routing.
var view = App.LandingScreenView.create({
container: App.__container__
});
I will figure out soon how this case can work easily.
My apologies, but I'm wrong (again). It isn't anything to do with a ContainerView and I don't have ember-touch working. So, to revert to my original comment, I am using the router - I've got a fairly standard Ember app - and I can't get ember-touch to work due to the error thrown in the original report.
The exception is thrown because your view has not setup the container, loot at how the view is extended here.
So,if you setup the container as I shown below or find any fix to setup the container on view creation, it must work.
I thought the view was configured with the container in the view creation.
Let me know, if you find a easy way to solve it. Anyway, I will take a look tomorrow using latest master, I think, maybe a last change has made the ember-touch setup not work anymore.
I'll try and find a workaround, but I ran your integration tests against the master I have (before the move to Handlebars RC4 from yesterday) and they failed with the same error, so it looks like something has changed in how a container is setup for a view.
Died on test #1 at eval (ember-touch/~tests/acceptance_tests/multiple_gestures:28:1)
at eval (ember-touch/~tests/acceptance_tests/multiple_gestures:290:3)
at eval (native)
at http://localhost:9292/tests/minispade.js:17:31
at Object.minispade.globalEval (http://localhost:9292/tests/minispade.js:18:14)
at Object.minispade.require (http://localhost:9292/tests/minispade.js:31:20)
at http://localhost:9292/tests/index.html?package=ember-touch:145:25: Cannot call method 'lookup' of undefined
Source:
TypeError: Cannot call method 'lookup' of undefined
at Em.View.reopen._createGestureManager (ember-touch/system/view_ext:33:62)
at Em.View.reopen.init (ember-touch/system/view_ext:19:10)
at superWrapper [as init] (ember:1051:16)
at new Class (ember:10996:15)
at Function.Mixin.create.create (ember:11294:12)
at Object.numStart (ember-touch/~tests/acceptance_tests/multiple_gestures:30:22)
at Object.Test.run (http://localhost:9292/tests/qunit/qunit-1.11.0.js:190:18)
at http://localhost:9292/tests/qunit/qunit-1.11.0.js:348:10
at process (http://localhost:9292/tests/qunit/qunit-1.11.0.js:1420:24)
at http://localhost:9292/tests/qunit/qunit-1.11.0.js:466:5
No, I can't get ember-touch to work at all with the latest ember master. See PR #18 for the changes to run the integration tests against the latest master.
OK, having investigated it further I have a series of commits that get it to work for me within a real project.
Unfortunately though it breaks the test suite as we now need a controller as well as a view because the container comes from:
this.view.get('controller.container')
In addition, I've altered the creation of the applicationGestureManager to happen in #willInsertElement of the Ember.View rather than #init, e.g:
Uncaught TypeError: Cannot call method 'lookup' of undefined
I faced this problem too, when using ContainerViews. But i do not think that refering to the controller and usings its container is the right way to go. The answer to this problem is to let the framework handle the view creation. Before the fix my code looked like this:
So did call create myself. But this not let Ember handle the creation and inject the needed container into the view. Instead i changed those lines to the following:
The method above is provided by Ember.ContainerView. Using this method ensures that the property containerView is set on your new View.
@mrship : I think this would be a better approach to your problem. From my perspective it looks awkward, that your controller is responsible for creating a view. This is actually the source of your problem, i think. You should move your logic concerning myView to your ContainerView and use createChildView.
Activity
ppcano commentedon May 16, 2013
I think, you are not using the router, aren't you?
With the current implementation, you have to pass the application container to the view, which is something done automatically when using ember-routing.
I will figure out soon how this case can work easily.
mrship commentedon May 16, 2013
I am using the router. I think it may have something to do with using a ContainerView with a currentViewBinding, e.g:
I'm using the latest Ember master to resolve an issue with currentViewBinding in RC3.
If I remove my ContainerView with a currentViewBinding then ember-touch works.
Sorry I can't be more help, but I'm unsure why/how currentViewBinding is causing the problem
mrship commentedon May 16, 2013
Also, if I pass the container to the controller.myView when I create it as you suggested, then ember-touch no longer throws an error. Graçias!
mrship commentedon May 16, 2013
My apologies, but I'm wrong (again). It isn't anything to do with a ContainerView and I don't have ember-touch working. So, to revert to my original comment, I am using the router - I've got a fairly standard Ember app - and I can't get ember-touch to work due to the error thrown in the original report.
ppcano commentedon May 16, 2013
The exception is thrown because your view has not setup the container, loot at how the view is extended here.
So,if you setup the container as I shown below or find any fix to setup the container on view creation, it must work.
I thought the view was configured with the container in the view creation.
Let me know, if you find a easy way to solve it. Anyway, I will take a look tomorrow using latest master, I think, maybe a last change has made the ember-touch setup not work anymore.
mrship commentedon May 16, 2013
I'll try and find a workaround, but I ran your integration tests against the master I have (before the move to Handlebars RC4 from yesterday) and they failed with the same error, so it looks like something has changed in how a container is setup for a view.
ppcano commentedon May 16, 2013
Thanks for the info. I will look at it soon and try to find a more convenient way to setup.
Meanwhile, does your configuration work for your case?
mrship commentedon May 16, 2013
No, I can't get ember-touch to work at all with the latest ember master. See PR #18 for the changes to run the integration tests against the latest master.
mrship commentedon May 16, 2013
OK, having investigated it further I have a series of commits that get it to work for me within a real project.
Unfortunately though it breaks the test suite as we now need a controller as well as a view because the container comes from:
In addition, I've altered the creation of the applicationGestureManager to happen in #willInsertElement of the Ember.View rather than #init, e.g:
Doing the call in #willInsertElement means that we actually have a controller to get the container from.
My changes are in PR #19 so you can review in more detail.
mavilein commentedon Aug 5, 2013
Today i also stumpled upon this error:
I faced this problem too, when using ContainerViews. But i do not think that refering to the controller and usings its container is the right way to go. The answer to this problem is to let the framework handle the view creation. Before the fix my code looked like this:
So did call create myself. But this not let Ember handle the creation and inject the needed container into the view. Instead i changed those lines to the following:
The method above is provided by Ember.ContainerView. Using this method ensures that the property containerView is set on your new View.
@mrship : I think this would be a better approach to your problem. From my perspective it looks awkward, that your controller is responsible for creating a view. This is actually the source of your problem, i think. You should move your logic concerning myView to your ContainerView and use createChildView.