How to make page transition animation in angular2 ?
I try this is code but not working
@Component({
selector:'myPagefirstPage',
})
@View({
template: `<div class="view-animate ng-animate" >
<h1>First Page</h1>
</div>`
And I put my animation class in css file like this
.view-animate.ng-enter {....}
But it doesn't work
The keyframes() function in Angular allows you to specify multiple interim styles within a single transition, with an optional offset to define the point in the animation where each style change should occur.
As of beta 15, basic transitions using e.g. .ng-enter
and .ng-enter-active
works. Note that you must add the ng-animate
class to the animated element. See this plunkr for an example http://plnkr.co/edit/WcH3ndMN0HOnK2IwOCev?p=preview
However, note that ng-leave
is not supported as of now as the DOM node is removed before out animation is done (see https://github.com/angular/angular/pull/6768)
As of December 2015, animations are not implemented in Angular 2 beta release, and are due in the final release.
http://angularjs.blogspot.com.au/2015/12/angular-2-beta.html
What comes next?
We're already hard at work on the set of improvements to move Angular 2 to its full and final release. While we will make many small improvements, the big ones for final are:
- Reducing Angular 2's payload size.
- Making the Angular CLI usable end to end throughout the development process.
- Creating a more developer-friendly route definition and link API for the Component Router.
- Support for animations.
- I18n and L10n support.
Edit: Animations are now in - http://angularjs.blogspot.com.au/2016/06/rc2-now-available.html
RC2 Now Available
Today we’re happy to announce that we are shipping Angular 2.0.0-rc2.
This release includes:
- Animation Framework
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With