all repos — litestore @ 2f78123709b0151b27276a8997148777061cfce8

A minimalist nosql document store.

Improved feedback in case of request errors.
* Closes #14.
h3rald h3rald@h3rald.com
Sun, 15 Mar 2015 18:27:24 +0100
commit

2f78123709b0151b27276a8997148777061cfce8

parent

fd483fcf0261275f31c4851ff7a5245a1306a403

3 files changed, 7 insertions(+), 5 deletions(-)

jump to
M app/js/modules/guide.jsapp/js/modules/guide.js

@@ -8,7 +8,7 @@ app.guide = {vm: {}};

app.guide.vm.init = function() { var vm = this; vm.id = m.prop(m.route.param("id")); - vm.content = Page.get(vm.id()); + vm.content = Page.get(vm.id()).then(function(content){return content}, vm.flashError); vm.edit = function(){ m.route("/document/edit/app/md/"+vm.id()+".md"); };
M app/js/modules/info.jsapp/js/modules/info.js

@@ -6,7 +6,8 @@

// Info Module app.info = {vm: {}}; app.info.vm.init = function() { - this.content = Info.get(); + var vm = this; + vm.content = Info.get().then(function(info){return info;}, vm.flashError); }; app.info.main = function(){ var vm = app.info.vm;

@@ -40,4 +41,4 @@ return v;

}; u.layout(app.info); -}()); +}());
M app/js/modules/tags.jsapp/js/modules/tags.js

@@ -6,8 +6,9 @@

// Tags Module app.tags = {vm: {}}; app.tags.vm.init = function(){ - this.id = m.route.param("id"); - this.docs = Doc.getByTag(this.id); + var vm= this; + vm.id = m.route.param("id"); + vm.docs = Doc.getByTag(vm.id).then(function(docs){return docs}, vm.flashError); }; app.tags.main = function(){ var docs = app.tags.vm.docs();