[英]Make a transition to a route + ember.js
I define my routes like: 我将路线定义为:
MainApp.Router.map(function() {
this.route("memes", {
path: "/memes"
});
this.route("map", {
path: "/map"
});
});
I know that I can transit to another route in side of a controller like: 我知道我可以在控制器一侧转接到另一条路线,例如:
this.transitionTo("memes");
My question is: How to transit to another route outside of ember? 我的问题是:如何过渡到余烬以外的另一条路线? Imagine that I've a JavaScript method like this: 想象一下,我有一个像这样的JavaScript方法:
function makeOutsideTransition(route){
//make ember transition
}
Thanks 谢谢
You can try with 您可以尝试
function makeOutsideTransition(route){
window.location.assign('#/' + route);
}
Or something like this. 或类似的东西。 If it's outside your ember app, you can simply use the js functions. 如果它在您的余烬应用程序之外,则只需使用js函数即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.