Skip to content

Instantly share code, notes, and snippets.

Created August 22, 2012 22:12
Show Gist options
  • Save txominpelu/3429945 to your computer and use it in GitHub Desktop.
Save txominpelu/3429945 to your computer and use it in GitHub Desktop.
Full code for the tutorial on ember.js states
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Playing with ember states</title>
<script src="" type="text/javascript" charset="utf-8"></script>
<script src="handlebars.js" type="text/javascript" charset="utf-8"></script>
<script src="ember-1.0.pre.debug.js" type="text/javascript" charset="utf-8"></script>
<script type="text/x-handlebars" data-template-name="master">
This is the master section.
<script type="text/x-handlebars" data-template-name="main">
My main with its context: {{ variable }}.
<script src="states.js" type="text/javascript" charset="utf-8"></script>
App = Ember.Application.create({
ApplicationController : Ember.Controller.extend({
ApplicationView : Ember.View.extend({
templateName: "master"
MainView : Ember.View.extend({
templateName: "main"
MainController : Ember.Controller.extend({
variable: "my main var"
Router : Ember.Router.extend({
root: Ember.Route.extend({
main: Ember.Route.extend({
route: '/main/',
connectOutlets: function(router, event) {
$(function() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment