Created
July 5, 2018 15:35
-
-
Save whisher/3c5b971d248aebbef393898fa9c840d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="col-lg-6 px-3" [@routeState]="getAnimationData(rOutlet)" style="overflow: hidden"> | |
| <router-outlet #rOutlet="outlet"></router-outlet> | |
| </div> | |
| animations: [ | |
| trigger('routeState', [ | |
| transition('* => *', [ | |
| group([ | |
| query(':enter', [ | |
| style({ | |
| transform: 'translateX(-100%)' | |
| }), | |
| animate('500ms ease-out') | |
| ], {optional: true}), | |
| query(':leave', [ | |
| animate('500ms ease-out', style({ | |
| transform: 'translateX(100%)' | |
| }),) | |
| ], {optional: true}) | |
| ]) | |
| ]) | |
| ]) | |
| ] | |
| getAnimationData(outlet: RouterOutlet) { | |
| const routeData = outlet.activatedRouteData['animation']; | |
| if (!routeData) { | |
| return 'login'; | |
| } | |
| return routeData['page']; | |
| } | |
| Devi aggiungere tipo | |
| data: {animation: {page: 'accessinfo'}} | |
| alle route | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment