In Ember, the application's state manager handles routing. Let's take a look at a simple example:
App.stateManager = Ember.StateManager.create({
start: Ember.State.extend({
index: Ember.State.extend({
route "/",| web: node app.js | |
| worker: node consumer.js |
| /** | |
| * A `tail -f` implementation in Node.js. | |
| * | |
| * Bratish Goswami | |
| * bratishgoswami AT gmail DOT com | |
| * | |
| */ | |
| var sys = require("sys"), | |
| fs = require('fs'), |
| Gemfile.lock |
| // ==UserScript== | |
| // @name Use Markdown, sometimes, in your HTML. | |
| // @author Paul Irish <http://paulirish.com/> | |
| // @link http://git.io/data-markdown | |
| // @match * | |
| // ==/UserScript== | |
| // If you're not using this as a userscript just delete from this line up. It's cool, homey. |
| class GridModel extends RW.Model | |
| defaults: | |
| area: | |
| selector: '.G_area' | |
| dimensions: ['h', 'v'] | |
| h: | |
| unit: null | |
| count: 12 | |
| gutter: 20 |
| require "rubygems" | |
| require "kramdown" | |
| require "albino" | |
| class Kramdown::Parser::AlbinoKramdown < Kramdown::Parser::Kramdown | |
| def replace_code(code, ptrn, f = false) | |
| if /\A\|(.+?)(!?)\|(?!\Z)/ =~ code then | |
| lang = $1 | |
| run = $2 |