[Angular2 Animation] Delay and Ease Angular 2 Animations

By default, transitions will appear linearly over time, but proper animations have a bit more customization to them by delaying when they start and controlling how slowly or quickly they move over time.

 

    animations:[
        trigger('signal', [
            state('void', style({
                'transform':'translateY(-100%)'
            })),
            state('go', style({
                'background-color':'green',
                'height':'100px'
            })),
            state('stop', style({
                'background-color':'red',
                'height':'50px'
            })),
            transition('* => *', animate('2s 1s cubic-bezier(0.455, 0.03, 0.515, 0.955)'))
        ])
    ]

 Duration 2s, Delay 1s.

posted @ 2016-10-28 17:38  Zhentiw  阅读(247)  评论(0编辑  收藏  举报