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 @@ ...@@ -73,8 +73,5 @@
<script src="js/controllers/todos.js"></script> <script src="js/controllers/todos.js"></script>
<script src="js/views/application.js"></script> <script src="js/views/application.js"></script>
<script src="js/views/todos.js"></script> <script src="js/views/todos.js"></script>
<script>
Todos.initialize();
</script>
</body> </body>
</html> </html>
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
storeNamespace: 'todos-emberjs', storeNamespace: 'todos-emberjs',
// Extend to inherit outlet support // Extend to inherit outlet support
ApplicationController: Ember.Controller.extend(), ApplicationController: Ember.Controller.extend(),
ready: function() {
this.initialize();
}
}); });
})( window ); })( window );
...@@ -31,10 +31,12 @@ define( 'app', [ ...@@ -31,10 +31,12 @@ define( 'app', [
ApplicationView: ApplicationView, ApplicationView: ApplicationView,
entriesController: EntriesController.create( entriesController: EntriesController.create(
{ store: new Store( 'todos-emberjs' ) } { store: new Store( 'todos-emberjs' ) }
) ),
ready: function() {
this.initialize();
}
}); });
App.initialize();
// Expose the application globally // Expose the application globally
return window.Todos = App; 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