简体   繁体   中英

ember.js: transitioning to the same route creates a stack overflow issue

this is my route:

photo: Ember.Route.extend({
      route: '/photo/:photo_id',
      showPhoto: Ember.Route.transitionTo('root.photo'),
      connectOutlets: function(router, photo) {
        console.log("TEST");
        router.get('applicationController').connectOutlet('photo', photo);
      },
    })

Within my PhotoView, I have a few places, where i have to show "related photos", whose thumbnails should also be clickable, so I have this

<a {{action showPhoto this href=true}}> ...photo... </a>

However, if I click on the links afterwards, I get a stack overflow error. How do I resolve this? I really need to route to the same view, but with new data

Replace

action showPhoto this href=true with

action showPhoto photo href=true

without jsfiddle it is hard to check my answer.

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