Created
January 12, 2015 15:15
-
-
Save ksol/4f75753d68ea18243daf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Do not do this | |
| var SomeController = Ember.ArrayController.extend({ | |
| init: function() { | |
| this._super.apply(this, arguments) // easy to forget, can introduce typos, etc | |
| // your code here | |
| } | |
| }); | |
| // Do this | |
| var SomeController = Ember.ArrayController.extend({ | |
| // The name of the function and the observing make the intent clearer | |
| // than the code above, and it can be reused if needed. | |
| // Also, less chances to do something wrong. | |
| somethingOnInit: function() { | |
| // your code here | |
| }.on('init') | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment