1
0
mirror of https://github.com/exane/not-gwent-online synced 2025-07-27 20:33:28 +00:00
Files
assets
client
public
server
site
client
app
modules
deck-builder
inner
landing
lobby
session
components
login.js
register.js
views
app.js
routes.js
assets
app.blade.php
gulpfile.js
package.json
public
server
test
.gitignore
gulpfile.js
package.json
not-gwent-online/site/client/app/modules/session/components/register.js
2015-06-23 16:24:49 +02:00

41 lines
685 B
JavaScript

module.exports = {
template: require('./../views/register.html'),
inherit: true,
data: function() {
return {
username: '',
password: '',
email: ''
}
},
methods: {
register: function(e) {
e.preventDefault();
if( ! this.username || ! this.password || ! this.email) {
$('.form-error').hide().fadeIn('fast');
return false;
}
$('.form-error').hide();
$('.icon-action-load').show();
this.$http.post('./api/register', this.$data, function(data) {
location.reload();
}).error(function (data) {
$('.icon-action-load').hide();
})
return false;
}
}
};