This.routerExtensions.back()调用方法/函数

时间:2016-11-25 16:30:25

标签: routing nativescript

所以对于我的应用程序,我需要能够执行this.router.back(或者正确的语法)。我做了import {Router} from "@angular/router";并添加了constructor(private router: Router) { }。我如何进行navigate.back?

--- --- EDIT 现在我已经导航回来了,如何在我导航回来的页面上运行方法/函数?

1 个答案:

答案 0 :(得分:2)

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

constructor(private routerExtensions: RouterExtensions){}

this.routerExtensions.back();

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