【发布时间】:2020-01-31 22:02:36
【问题描述】:
我有一个上传图片的函数,我想在结束这个函数后导航到下一个组件。在 app-routing.module.ts 我做了必要的配置,但我不知道如何做 navigation 。
【问题讨论】:
标签: nativescript
我有一个上传图片的函数,我想在结束这个函数后导航到下一个组件。在 app-routing.module.ts 我做了必要的配置,但我不知道如何做 navigation 。
【问题讨论】:
标签: nativescript
听起来你正在使用角度。
import { RouterExtensions } from 'nativescript-angular/router';
// ...
constructor(private routerEx: RouterExtensions) {
}
yourFunction(): void {
// do your stuff
this.routerEx.navigate(['your route']);
}
【讨论】:
if (response == ...) 时,请执行我在上面的回答中提供的 this.routerEx.navigate。
onClose(status:string){ this.params.closeCallback(status); } 和函数uploadPhoto this.onClose('success')