How can I use ng-animate with ui-view rather than ng-view?

后端 未结 8 1755
自闭症患者
自闭症患者 2020-12-13 00:26

I am using angular-ui-router with angularJS v1.2 and would like to implement custom page transitions.
How can I use ng-animate with ui-view (from angular-ui-router) rath

8条回答
  •  死守一世寂寞
    2020-12-13 01:08

    Avoid the view name for named-views or id for that element.

    For example, if this is your html

    Instead of:

    /*AVOID*/
    div#home-page[ui-view="home"].ng-enter {
        /*ENTER STYLES*/
    }
    div#home-page[ui-view="home"].ng-enter-active {
        /*...ENTER-ACTIVE-STYLES*/
    }
    

    Try:

    div[ui-view].ng-enter {
        /*...ENTER-STYLES*/
    }
    div[ui-view].ng-enter-active {
        /*...ENTER-ACTIVE-STYLES*/
    }
    

    Good Luck.

提交回复
热议问题