Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8377755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:45:07+00:00 2026-06-09T15:45:07+00:00

I have set up some basic routing in my app by using the examples

  • 0

I have set up some basic routing in my app by using the examples at http://emberjs.com/guides/outlets/#toc_the-router

Within the root I have some events that trigger from view actions e.g:

gotoStepOne: Ember.Route.transitionTo('stepOne'),
gotoStepTwo: Ember.Route.transitionTo('stepTwo'),
gotoStepThree: Ember.Route.transitionTo('stepThree'),
gotoStepFour: Ember.Route.transitionTo('stepFour'),
gotoStepFive: Ember.Route.transitionTo('stepFive'),

Full example router code at http://jsfiddle.net/hellosmithy/WdjXT/

This all works fine at the moment. The problem is that I’d like to add other code into these events. For example:

gotoStepOne: function() {
    if (someCondition) {
        Ember.Route.transitionTo('stepOne');
    }
    someOtherFunction();
}

However doing this breaks the routing without throwing any errors. It just no longer transitions.

Specifically I only want transitions to happen if a certain state is met – something has been selected or input by the user at each stage before they can proceed. Is there a workaround for this, or should I be abstracting this functionality elsewhere?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:45:08+00:00Added an answer on June 9, 2026 at 3:45 pm

    The way I understand the router is, that it is the representation of the application’s state.

    Specifically I only want transitions to happen if a certain state is met – something has been selected or input by the user at each stage before they can proceed.

    So the user inputting or selecting something puts your application in a certain state which is reflected by the router.

    IMHO it should be something like this in a view (or controller):

    userDidSomething: function(condition) {
      if (condition) {
        App.get('router').send('stepOne');
      }else{
        someOtherFunction();
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to set some routing rules in my php application, and they should
I want to set some locations and have my app check if its by
I'm using Google Test Framework to set some unit tests. I have got three
I have some basic pageview incrementing code set up on a LAMP server (see
We have a Java web application and we'd like to set up some basic
Ive just set up some basic models using scaffold with Rails, i've edited the
I have a Rails app with some basic models. The website displays data retrieved
I have set up just some basic panels that I'm trying to slide in
i have set up a basic client and a basic server using java sockets.
In my init I have set some variables and one animate that uses those

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.