angular-ui/ui-router — pull request #553 by dlukez (2013-11-03 03:57:57+00:00)
Title: View directive refactor for angular 1.2

Had a play around with an alternative refactor for angular 1.2 as a result of the issue brought up by @arush in issue #320.

May have been overkill considering there was probably one or two lines that were causing said issue but this is where I ended up. The code closely mimics that of ui-router/master and ngView and uses transclusion.

It passes the recently updated tests and an extra one added from the master branch, tweaked for this branch. It's working in two projects I'm using at home. Also updated the test libs with 1.2.0-rc.3 and the karma file since 'grunt karma' was telling me off.

I also added animation events that fire when a view animation starts/ends since in a project I'm working on I wanted to prevent certain actions from being run while the state was changing or the animation was running. In hindsight, I could have solved this problem by checking for animation classes on the view element to determine if an animation is running, but this was simpler. There are no animation events used elsewhere in Angular, so I'm not opposed to removing it.