Nativescript + Angular: Transition when redirect

Asked

Viewed 49 times

0

You can create a "slide" transition effect using outlet router in an application built with Angular + Native script?

Creating the effect on a button or any other element is fine, my problem is when I try to do it dynamically.

Example:

var info = args.view.bindingContext;

let navigationExtras: NavigationExtras = {
    queryParams: info
};

this.router.navigate(["/expense-details"], navigationExtras);

I would like to add the "slide" transition effect when directing to the "/Expense-Details page".

  • 1

    Have you taken a look at this part of the documentation of angular? https://angular.io/guide/route-animations

  • 1

    Thanks @Veronesecoms, I looked at the documentation more carefully and noticed that when using nativescript with Angular has a class called "routerExtensions", very similar to that of the Angular documentation, and that is imported through the "nativescript-angular"using it I was able to pass the parameters and make the animation I wanted.

1 answer

1

I was able to solve by importing the "Routerextensions" component from Nativescript.

// Importa
import { RouterExtensions } from "nativescript-angular";

// Redireciona passando parametros e animação
this.routerExtensions.navigate(['/expense-details'],
    {
        queryParams: info,
        animated: true,
        transition: {
            name: "slide",
            duration: 200,
            curve: "linear"
        }
    }
)
/questions/364816/nativescript-angular-transition-ao-fazer-redirect#

Browser other questions tagged

You are not signed in. Login or sign up in order to post.