Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Injecting $scope into an Animation silently fails #2556

Closed
jpillora opened this issue May 1, 2013 · 5 comments
Closed

Injecting $scope into an Animation silently fails #2556

jpillora opened this issue May 1, 2013 · 5 comments

Comments

@jpillora
Copy link

jpillora commented May 1, 2013

See bug here: http://jsfiddle.net/jpillora/wKpqG/3/

Animation works where I haven't tried to inject $scope. I guess it makes sense that there's no scope for an animation though I was hoping to get the parent controller. Maybe an error would be nice ? Spent over an hour trying to figure out what was happening...

@ghost ghost assigned jbdeboer May 1, 2013
@mhevery
Copy link
Contributor

mhevery commented May 1, 2013

@matsko This is an issue with the try cath eating exceptions.

@mhevery
Copy link
Contributor

mhevery commented May 1, 2013

@jpillora failing silently is definitely an error, and it will be fixed, however I am not sure that I understand the use case for injecting $scope. As it stands now the architecture of the code makes it very unlikely that we would be able to inject a $scope into the function. Could you elaborate more on the use case?

@jpillora
Copy link
Author

jpillora commented May 2, 2013

Hi Miško, you're right about the lack of use cases, my use case is a work around for the lack of onSetup and onStart animation events. I need to wipe the bound model of the newly hidden input. So as well as hiding, I'm also nulling portions of the parent scope. Maybe these events do exist and I couldn't find them or maybe you know of a better way to hook into something that will give me the equivalent ? (Currently I'm using DOM attributes to discern the parent scope, something like: $scope = $rootScope[elem.closest('.section').attr('scope')] )

@jpillora
Copy link
Author

jpillora commented May 2, 2013

If the injector can't access $scope for example, will it still silently fail ? or does return undefined produce the error ?

mhevery added a commit to mhevery/angular.js that referenced this issue May 2, 2013
@mhevery mhevery closed this as completed in 80341cb May 2, 2013
@jpillora
Copy link
Author

jpillora commented May 2, 2013

👍

matsko pushed a commit to matsko/angular.js that referenced this issue May 6, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants