Commit 846dd50d authored by Sindre Sorhus's avatar Sindre Sorhus

Emberjs app: Make sure the app isn't initialized before doc ready. Fixes #249

parent f11f1ace
......@@ -73,8 +73,5 @@
<script src="js/controllers/todos.js"></script>
<script src="js/views/application.js"></script>
<script src="js/views/todos.js"></script>
<script>
Todos.initialize();
</script>
</body>
</html>
......@@ -7,6 +7,9 @@
storeNamespace: 'todos-emberjs',
// Extend to inherit outlet support
ApplicationController: Ember.Controller.extend(),
ready: function() {
this.initialize();
}
});
})( window );
......@@ -31,10 +31,12 @@ define( 'app', [
ApplicationView: ApplicationView,
entriesController: EntriesController.create(
{ store: new Store( 'todos-emberjs' ) }
)
),
ready: function() {
this.initialize();
}
});
App.initialize();
// Expose the application globally
return window.Todos = App;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment