I'm using JSBIN to test out some Ember stuff and I can't seem to display my model data.
Unfortunately on only error I get is "Script error (line 0)" which isn't very helpful.
JSBIn here: http://jsbin.com/duqehebewu/3/edit?html,console,output
<script src="http://static.iamstef.net/ember-cli-jsbin/jquery/dist/jquery.js"></script>
<script src="http://static.iamstef.net/ember-cli-jsbin/loader.js/loader.js"></script>
<script src="http://static.iamstef.net/ember-cli-jsbin/handlebars/handlebars.js"></script>
<script src="http://static.iamstef.net/ember-cli-jsbin/ember/ember.js"></script>
<script src="http://static.iamstef.net/ember-cli-jsbin/ember-load-initializers/ember-load-initializers.js"></script>
<script src="http://static.iamstef.net/ember-cli-jsbin/ember-resolver/dist/ember-resolver.js"></script>
<script src="http://static.iamstef.net/ember-cli-jsbin/ember-cli-shims/app-shims.js"></script>
<script src="http://static.iamstef.net/ember-cli-jsbin/ember-cli.js"></script>
<meta name="ember-app" content="app" mode="auto-run">
<script type='text/x-esnext' id='app/app'>
import Ember from 'ember';
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import config from './config/environment';
Ember.MODEL_FACTORY_INJECTIONS = true;
var App = Ember.Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver: Resolver
});
loadInitializers(App, config.modulePrefix);
export default App;
</script>
<script type='text/x-esnext' id='app/config/environment'>
export default { modulePrefix: 'app', locationType: 'hash'};
</script>
<script type='text/x-esnext' id='app/router'>
import Ember from 'ember';
import config from './config/environment';
var Router = Ember.Router.extend({
location: config.locationType,
});
export default Router;
</script>
<script type='text/x-esnext' id='app/router/index'>
import Ember from 'ember';
import config from './config/environment';
var posts = [{
title: "Rails is omakase",
body: "There are lots of à la carte software environments in this world."
}, {
title: "Broken Promises",
body: "James Coglan wrote a lengthy article about Promises in node.js."
}];
var IndexRouter = Ember.Router.extend({
location: config.locationType,
model: function() {
return posts;
}
});
export default IndexRouter;
</script>
<script type='text/x-handlebars' id='app/templates/application'>
<h2 id='title'>Welcome to Ember.js</h2>
{{outlet}}
</script>
<script type='text/x-handlebars' id='app/templates/index'>
<h1>Index template</h1>
{{#each}}
{{body}}
{{/each}}
</script>
I'm not sure how to do Ember cli stuff in JSBin. Here's a not-cli version:
http://jsbin.com/zixaju/2/edit
Edit: Got it.
http://jsbin.com/qimeta/2/edit
Edit2: For real: