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 7756613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:52:06+00:00 2026-06-01T12:52:06+00:00

The StateManager in Ember.js isn’t that well documented yet, so I’ve got some questions

  • 0

The StateManager in Ember.js isn’t that well documented yet, so I’ve got some questions regarding its usage.

  1. Should one strive to call .goToState only from within the state manager?
  2. I sometimes find myself mirroring methods in the state manager on the view, e.g. save: -> StateManager.send("save"). Does that make sense or am I missing something?
  3. Should all modification of models (generally) go through the state manager?
  4. If one view has different states, should that be modeled using a ViewState with child states, or should I use computed properties and view properties to hold that information only in the view (without the state manager knowing of the views internal state)?*

*One example could be a three-step form, where the same template is used for all states but different areas are shown/hidden in the three steps.

Github reference: https://github.com/emberjs/ember.js/tree/master/packages/ember-states/lib

  • 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-01T12:52:08+00:00Added an answer on June 1, 2026 at 12:52 pm

    Should one strive to call .goToState only from within the state
    manager?

    Probably. I don’t know this for certain, but it seems to me that because the state manager knows what state you’re in, it’s the place to enforce legal state transitions. If you called .goToState from outside the state manager, you’re doing it without really knowing what state you’re in, and while that’s sometimes OK (maybe it’s a state you really can reach from any other state) it’s not a great habit to be in.

    I sometimes find myself mirroring methods in the state
    manager on the view, e.g. save: -> StateManager.send(“save”). Does
    that make sense or am I missing something?

    I like what pangratz has to say about this.

    Should all modification of
    models (generally) go through the state manager?

    The way I use statecharts, no. I’ve seen some people using statecharts as pretty much a complete replacement for the controller layer, however, and if that’s how you’re working, then yes, it should go through the state manager. The pattern is to avoid direct manipulation of models from views; whether it’s a controller layer or a state manager in between seems like a moot point to me.

    The way I use state charts, however, the state manager is made to manage the state of the application. It can play traffic manager for the modification of models if that modification will change the state of the application (e.g. if there’s a progress indicator while an update completes), but it seems to me that model updates aren’t part of its mandate; they belong to controllers.

    If one view has
    different states, should that be modeled using a ViewState with child
    states, or should I use computed properties and view properties to
    hold that information only in the view (without the state manager
    knowing of the views internal state)?

    I think the state manager needs to know (or ought to know) the view’s internal state.

    Out of curiosity, are you coming from a web development background, or a desktop/mobile app development background? I came from web development, and state charts were a new concept for me. I found it very useful to read the canonical State Chart paper by David Harel (‘ware PDF!). It’s surprisingly readable for an academic paper and lays out the basic state chart concept most of the SproutCore/Ember world has been using since late 2010 (i.e. it’s what Michael Cohen had in mind when he wrote Ki.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was previously working with Ember.StateManager and now I'm doing some tests before I
When using Ember.StateManager, the most common transition between Em.States involve some parameter or another.
In the documentation of Ember.StateManager it's said that : Inside of an action method
I tried to play with the Ember.StateManager and got the following issue. I have
I have the following StateManager: Lead.StateManager = Ember.StateManager.extend initialState: 'notParsing' notParsing: Ember.State.create startParsing: (manager,
Emberjs core has a new router implementation which extends Ember.StateManager. This is the basic
I'm trying to get StyleManager to have some effect, to no avail. package {
I have an entity model that has audit information on every table (50+ tables)
I am working on a FYI page that has large list of top-tiered links.
I have a MVC 2.0 site that uses SQL Server as it's session state

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.