diff --git a/client/loading.html b/client/loading.html new file mode 100644 index 0000000..40796df --- /dev/null +++ b/client/loading.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/client/projects.js b/client/projects.js index 4fbfd58..fc87a0c 100644 --- a/client/projects.js +++ b/client/projects.js @@ -1,7 +1,3 @@ -Template.management.onCreated(function(){ - Meteor.subscribe('projects'); -}); - Template.management.helpers({ projects: function () { return ProjectService.list(); diff --git a/lib/routes.js b/lib/routes.js index 6c1463f..4c42b21 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -7,5 +7,13 @@ Router.map(function () { this.route('home', { path: '/', }); - this.route('management'); + this.route('management', function() { + this.subscribe('projects').wait(); + + if (this.ready()) { + this.render(); + } else { + this.render('Loading'); + } + }); }); \ No newline at end of file