5
ApplicationRoute
의 동작이 goBack
인 경우 (다른 모바일 브라우저의 버그로 인해 goBack을 직접 처리해야합니다.) :Ember.js : 중첩 된 경로에서 ApplicationRoute의 동작 호출
Mobile.ApplicationRoute = Em.Route.extend
actions:
goBack: ->
# TODO: Remove when iOS 7 fixed their history
# If there's no route to go back, go to front
# TODO: Remove when Microsoft fixed their
# back button in offline mode
if not (Nn.MobileHelper.isiPhone() or Nn.MobileHelper.isIeMobile()) and @get("router.recentRoute")?
return window.history.back()
@get("controller").set("isHitBackButton", true)
@transitionTo("front").then => @get("controller").set("isHitBackButton", false)
이 동작을 다른 경로에서 어떻게 트리거 할 수 있습니까? @transitionTo
을 호출해야하므로이 코드는 반드시 경로 안에 있어야합니다.