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

后端 未结 8 1780
自闭症患者
自闭症患者 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:09

    I just posted a tutorial with a working demo for using ngAnimate (1.4.8) with UI Router.

    It shows a couple of different view animations, a fade in transition on the main view and a slide in/out transition on a nested view.

    Here's a snippet from the LESS file for the fade in transition on the main view:

    main {
        /* start 'enter' transition */
        &.ng-enter {
            /* transition on enter for .5s */
            transition: .5s;
    
            /* start with opacity 0 (invisible) */
            opacity: 0;
        }
    
        /* end 'enter' transition */
        &.ng-enter-active {
            /* end with opacity 1 (fade in) */
            opacity: 1;
        }
    }
    

提交回复
热议问题