Skip to content

[1.2 branch] Need a way to opt into the old animation behaviour for ui-view #534

Closed
@jonrimmer

Description

@jonrimmer

In 0.2, animations are applied to the child elements of the ui-view. However, in the 1.2 branch, this has been changed so the animations are applied on the ui-view element itself, which is cloned when the view changes.

Unfortunately, this approach breaks a vital styling requirement: The ability to use the :empty CSS selector to style the ui-view when it contains no child elements, e.g. when it has no view selected, and then transition to a different appearance when a view is selected.

This plunkr demonstrates how it is done in 0.2: http://plnkr.co/edit/B31D5b?p=preview

As far as I can tell, this example is impossible to replicate using the 1.2 branch. Neither ngAnimate nor a wrapping element can be used to achieve the same effect.

I suggest that ui-view defaults to the new animation behaviour, in order to match Angular 1.2, but provides a switch that replicates the old behaviour if required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions