gpt4 book ai didi

javascript - 如何在不使用Ember进行URL重定向的情况下处理错误

转载 作者:行者123 更新时间:2023-12-03 08:54:38 26 4
gpt4 key购买 nike

我想要做的是在不更改用户URL路径的情况下呈现自定义错误,因此不能使用this.transitionTo。

到目前为止,以下方法有效:

v1.10.1-http://emberjs.jsbin.com/tezazakiye/1/edit

但是从v1.11.0开始,没有办法使其能够正常工作

v.1.11.3-http://emberjs.jsbin.com/rilenafaqe/1/edit

根据https://github.com/emberjs/ember.js/issues/10884https://github.com/emberjs/ember.js/issues/11136,这似乎是“正常”的,因为获得的错误是:
Error while processing route: stories.index Cannot read property 'push' of undefined TypeError: Cannot read property 'push' of undefined
如果我很好理解,这是正常现象,现在无法从错误操作中调用render(),那么执行此操作的好方法是什么?

(我也在github上发布了:https://github.com/emberjs/ember.js/issues/11282)

非常感谢你。

最佳答案

不确定是否符合您的条件,但是您可以使操作冒泡,以便applicationRoute像下面这样处理您的错误操作:http://emberjs.jsbin.com/pehanoveko/1/

关于javascript - 如何在不使用Ember进行URL重定向的情况下处理错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30487136/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com