mirror of
https://github.com/Febbweiss/ProjectDeployer.git
synced 2026-03-04 22:25:38 +00:00
Optim: subscriptions managed by router
This commit is contained in:
3
client/loading.html
Normal file
3
client/loading.html
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<template name="loading">
|
||||||
|
<h1>Please wait...</h1>
|
||||||
|
</template>
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
Template.management.onCreated(function(){
|
|
||||||
Meteor.subscribe('projects');
|
|
||||||
});
|
|
||||||
|
|
||||||
Template.management.helpers({
|
Template.management.helpers({
|
||||||
projects: function () {
|
projects: function () {
|
||||||
return ProjectService.list();
|
return ProjectService.list();
|
||||||
|
|||||||
@@ -7,5 +7,13 @@ Router.map(function () {
|
|||||||
this.route('home', {
|
this.route('home', {
|
||||||
path: '/',
|
path: '/',
|
||||||
});
|
});
|
||||||
this.route('management');
|
this.route('management', function() {
|
||||||
|
this.subscribe('projects').wait();
|
||||||
|
|
||||||
|
if (this.ready()) {
|
||||||
|
this.render();
|
||||||
|
} else {
|
||||||
|
this.render('Loading');
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user