import Ember from 'ember';
import Firebase from 'firebase';
export default Ember.Controller.extend({
actions: {
signUp: function() {
var artistName = this.get('artistName');
var email = this.get('email');
var password = this.get('password');
ref.createUser({
email: email,
password: password
}, function(error, userData) {
if (error) {
alert(error);
} else {
this.get('session').open('firebase', {
provider: 'password',
'email': email,
'password': password
}).then(function(){
var artist = this.store.createRecord('artist', {
id: userData.uid,
artistName: artistName
});
artist.save()
.then(function(){
this.transitionTo('index');
});
});
}
});
}
}
});