angular2-animation

angular 2 animation vs css animation - when to use what?

断了今生、忘了曾经 提交于 2019-11-30 07:25:00
问题 I'm currently trying out angular2's animation and I was wondering what specific advantage they bring over standard css animations/transitions. e.g. a typical material designed card and hover effects with the box shadows. Most css frameworks use :hover and css-transitions. Is there a particular advantage in using angular 2 animations? I read somewhere that some css animation properties don't invoke the GPU as much, hence there's somethings delays and lags. What about angular2 animations? 回答1:

how to apply different animation between different route in angular 2

走远了吗. 提交于 2019-11-29 15:33:23
I have a test app build with angular 2, I have successfully applied one animation between route change state('default', style({ opacity: 1, transform: 'scale(1) translateY(0)' })), transition('void <=> default', [ style({ opacity: 0, transform: 'scale(.9) translateY(-20px)' }), animate('.2s') ]) But I also want a different animation when a list page change to an item page, like click a hero inside a hero-list, so I did this state('childActivate', style({ opacity: 1, transform: 'scale(1) translateY(0)' })), transition('childActivate => void', [ animate('1.2s', style({ transform: 'scale(0.9)

angular 2 animation vs css animation - when to use what?

别说谁变了你拦得住时间么 提交于 2019-11-29 02:52:21
I'm currently trying out angular2's animation and I was wondering what specific advantage they bring over standard css animations/transitions. e.g. a typical material designed card and hover effects with the box shadows. Most css frameworks use :hover and css-transitions. Is there a particular advantage in using angular 2 animations? I read somewhere that some css animation properties don't invoke the GPU as much, hence there's somethings delays and lags. What about angular2 animations? The question is actually more javascript animation vs css animation (because angular2's animations are based

how to apply different animation between different route in angular 2

雨燕双飞 提交于 2019-11-28 09:43:15
问题 I have a test app build with angular 2, I have successfully applied one animation between route change state('default', style({ opacity: 1, transform: 'scale(1) translateY(0)' })), transition('void <=> default', [ style({ opacity: 0, transform: 'scale(.9) translateY(-20px)' }), animate('.2s') ]) But I also want a different animation when a list page change to an item page, like click a hero inside a hero-list, so I did this state('childActivate', style({ opacity: 1, transform: 'scale(1)

How do you create reusable Animations in Angular 2

怎甘沉沦 提交于 2019-11-28 03:47:46
I'm playing with the Animation API, and I'd like to create a reusable animation like say sliding in content for top level router views. I managed to get through the funky meta data syntax (which is actually pretty cool once get past the crazy idea of using metadata) to get the animations mostly working. @Component({ //moduleId: module.id, selector: 'album-display', templateUrl: './albumDisplay.html', animations: [ trigger('slideIn', [ state('*', style({ transform: 'translateX(100%)', })), state('in', style({ transform: 'translateX(0)', })), state('out', style({ transform: 'translateX(-100%)',

How do you create reusable Animations in Angular 2

霸气de小男生 提交于 2019-11-27 05:11:23
问题 I'm playing with the Animation API, and I'd like to create a reusable animation like say sliding in content for top level router views. I managed to get through the funky meta data syntax (which is actually pretty cool once get past the crazy idea of using metadata) to get the animations mostly working. @Component({ //moduleId: module.id, selector: 'album-display', templateUrl: './albumDisplay.html', animations: [ trigger('slideIn', [ state('*', style({ transform: 'translateX(100%)', })),

Can you move your animations to an external file in Angular2?

时间秒杀一切 提交于 2019-11-27 01:08:24
问题 The @Component annotation provides us with an animations property. This can be used to define a list of triggers each with a lot of state and transition properties. When you add multiple animations to a component, this list can become pretty long. Also some animations would be really nice to use in other components as well. Having to put them directly in each component seems tedious and is repetitive - plus it violates the DRY principle. You can define the template and styles properties on