Created
October 5, 2012 23:27
-
-
Save odigity/3843051 to your computer and use it in GitHub Desktop.
A bare-bones Ember.js app that works locally, but not on jsFiddle.net.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Test</title> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script> | |
<script src="//cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.rc.1.js" type="text/javascript"></script> | |
<script src="//cloud.github.com/downloads/emberjs/ember.js/ember-latest.js" type="text/javascript"></script> | |
</head> | |
<body> | |
Shiny! | |
<script type="text/javascript"> | |
var App = Ember.Application.create(); | |
App.ApplicationController = Ember.Controller.extend({ foo: 22 }); | |
App.ApplicationView = Ember.View.extend({ bar: 44 }); | |
App.Router = Ember.Router.extend({ | |
enableLogging: true, | |
root: Ember.Route.extend({ | |
index: Ember.Route.extend({ | |
route: '/' | |
}) | |
}) | |
}); | |
</script> | |
<script type="text/x-handlebars"> | |
<h1>Hello from Ember.js</h1> | |
<p>foo: {{foo}}</p> | |
<p>controller.foo: {{controller.foo}}</p> | |
<p>bar: {{bar}}</p> | |
<p>view.bar: {{view.bar}}</p> | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment