简体   繁体   中英

Strange transition_to behavior

I've come across some unexpected behavior when using transition_to from a router.

What happens is that the route changes correctly but the {{outlet}} is not cleared.

I boiled down the example as much as possible in this jsbin .

I have a authorize and a secret resource, when jumping from the secret resource back to the authorize resource the contents of the secrets template (yellow) stay in place: 在此处输入图片说明

My expectation would be that the secrets template disappears and the authorize template is rendered into the {{outlet}} instead.

Weirdly enough the ember inspector also doesn't pick up on it: 在此处输入图片说明

I am fairly new to ember, so my assumption is that I am doing something wrong, but this kind of looks like a bug.

You likely have bad HTML in your handlebars, mismatched tags is the biggest reason for this.

Your secret template has two opening div tags.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM