Skip to content

Instantly share code, notes, and snippets.

@fozy81
Last active June 21, 2019 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fozy81/4243069ebaa54a6e71c19017b59cb67b to your computer and use it in GitHub Desktop.
Save fozy81/4243069ebaa54a6e71c19017b59cb67b to your computer and use it in GitHub Desktop.
Ember mental model

Ember mental model

  • All aboard the Ember train! choo choo

Ember is like a train set. Using small, composable pieces, an ambitious railway of trains, lines and stations can be constructed.

Templates

Each station is a web page made from a Template. Templates are written in a language called Handlebars - an extended version of html. You can build your station using just the handlebar template.

Components

A railway is not complete without trains! Trains allow you to move objects between stations. This is a nice way to think about Components. The same train can appear at different stations - although the train may contain different passengers and so appear a little different.

Controllers

Each station has a single Controller. This is like a station manager who provides information to trains currently in the station.

Routes

Routes are like station information boards. At a minimum, they are URLs which describe which station you are currently visiting. They may also tell you what's currently happening at that station.

Services

You can provide services at stations and on-board trains. For instance, selling tickets or a food trolley service. Services share their information between stations so they can keep a realtime track of the tickets they sell or the stock on their trolley.

Ember data

Ember data opens your station to passengers. The data model creates a turnstile for your stations, only allowing passengers with the right credentials to enter. Passengers can move between stations and board trains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment