var hoodie = new Hoodie("http://api.appjs.dev");
hoodie.store.on('add:task', function(object) {
$('.taskList').append('<li>'+object.desc+'</li>');
});
$('.addTask .submit').click(function(event){
event.preventDefault();
var desc = $('.addTask .desc').val();
hoodie.store.add('task', {desc: desc});
});
$('.signUp .submit').click(function(event){
event.preventDefault();
var username = $('.signUp .username').val();
var password = $('.signUp .password').val();
hoodie.account.signUp(username, password).done(function(object){
$('#modal').modal('hide');
$('.welcome').text('Hello, '+hoodie.account.username);
});
});
$('.signIn .submit').click(function(event){
event.preventDefault();
var username = $('.signIn .username').val();
var password = $('.signIn .password').val();
hoodie.account.signIn(username, password).done(function(object){
$('#modal').modal('hide');
$('.welcome').text('Hello, '+hoodie.account.username);
});
});
hoodie.store.findAll('task').done(function(tasks){
$('.taskList').empty()
tasks.forEach( function( task ){
$('.taskList').append('<li>'+task.desc+'</li>');
});
});
-
Notifications
You must be signed in to change notification settings - Fork 2
xiejuntao/demo
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
The live demo for Hoodie presentations
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published