How can we reload a route Ember JS (versoin 1.0.0-rc.1)

China☆狼群 提交于 2019-12-25 02:07:20

问题


I have a condition where my route:

application.com/#/sample/:id is redirected back to application.com/#/sample/:id For example, application.com/#/sample/1 gets an event which redirects to application.com/#/sample/2

This does not cause a reload. Has any one got this case fixed?

Actually I am having a case application.com/#/parent/123/sample/1 causing redirect to application.com/#/parent/123/sample/2

Event is received by ParentRouter to transitionTo("parent.sample",{id:2}).

What I get in the log is:

Uncaught Error: assertion failed: Emptying a view in the inBuffer state is not allowed and should not happen under normal circumstances. Most likely there is a bug in your application. This may be due to excessive property change notifications.


回答1:


For transit into route manually, you may try these two methods:

  1. For routes with different name:

    App.Router.router.transitionTo(name, params);

  2. For routes with same name:

    App.Router.router.getHandler(name).enter();

    It should be identical to call enter event of route. (I'm not sure)




回答2:


The issue is fixed. Its was a NULL handling issue in the handlebars. I made some additional check for nulls. It works now.

There have been some similar issues filed on Github, we can always reload the current route and redirect back to any route.

Thanks for help.



来源:https://stackoverflow.com/questions/16008047/how-can-we-reload-a-route-ember-js-versoin-1-0-0-rc-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!