Improved feedback in case of request errors. * Closes #14.
h3rald h3rald@h3rald.com
Sun, 15 Mar 2015 18:27:24 +0100
3 files changed,
7 insertions(+),
5 deletions(-)
M
app/js/modules/guide.js
→
app/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.js
→
app/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); -}()); +}());