mast3rd3mon mast3rd3mon - 3 days ago 6
AngularJS Question

This.routerExtensions.back() to call a method/function

So for my app, I need to be able to do this.router.back (or whatever the correct syntax would be). I did

import {Router} from "@angular/router";
and added
constructor(private router: Router) { }
. How do I do a navigate.back?

---EDIT---
Now that I have navigated back, how do I get a method/function to run when on the page I navigate back to?

Answer

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

constructor(private routerExtensions: RouterExtensions){}

this.routerExtensions.back();

http://docs.nativescript.org/angular/core-concepts/angular-navigation#navigating-back

Comments