Last active
August 29, 2015 14:04
-
-
Save gcollazo/34dddf5f526155e6e004 to your computer and use it in GitHub Desktop.
Super simple example initializer for ember-cli, injected to all routes.
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
import Ember from 'ember'; | |
var RegistrationManager = Ember.Object.extend({ | |
signup: function(email, password) { | |
console.log('Register:', email, password); | |
} | |
}); | |
export default { | |
name: 'registration', | |
initialize: function(container, app) { | |
app.register('reg:main', RegistrationManager); | |
app.inject('route', 'reg', 'reg:main'); | |
} | |
}; | |
/* | |
Now on routes you can use this as | |
this.reg.signup('user@example.com', 'abc123'); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment