{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/4429","labels_url":"https://api.github.com/repos/meteor/meteor/issues/4429/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/4429/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/4429/events","html_url":"https://github.com/meteor/meteor/issues/4429","id":79317437,"number":4429,"title":"Why does my template not reactive?","user":{"login":"sato-v","id":12555857,"avatar_url":"https://avatars.githubusercontent.com/u/12555857?v=3","gravatar_id":"","url":"https://api.github.com/users/sato-v","html_url":"https://github.com/sato-v","followers_url":"https://api.github.com/users/sato-v/followers","following_url":"https://api.github.com/users/sato-v/following{/other_user}","gists_url":"https://api.github.com/users/sato-v/gists{/gist_id}","starred_url":"https://api.github.com/users/sato-v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sato-v/subscriptions","organizations_url":"https://api.github.com/users/sato-v/orgs","repos_url":"https://api.github.com/users/sato-v/repos","events_url":"https://api.github.com/users/sato-v/events{/privacy}","received_events_url":"https://api.github.com/users/sato-v/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-22T06:36:56Z","updated_at":"2015-05-22T07:48:10Z","closed_at":null,"body":"In client startup I subscribe to something:\r\n\r\n     Meteor.publish(\"Roles\", function(){\r\n       return Roles.find();\r\n     });\r\n\r\n     Meteor.startup(function() {\r\n       if(Meteor.isClient) {\r\n         Meteor.subscribe('Roles');\r\n       }\r\n     });\r\n\r\nAnd roles template:\r\n\r\n     Template.roles.helper(function() {\r\n       allRoles: function() {\r\n         return Roles.find();\r\n       }\r\n     })\r\n\r\nhtml\r\n\r\n          <template name=\"roles\">\r\n          <div>\r\n            {{#with allRoles}}\r\n              <label>{{> role }}</label>\r\n           {{/with}}\r\n          </div>\r\n        </template>\r\n\r\nThe problem is sometime `roles` template is rendered before the `Roles` is ready.\r\nSo these is no role labels displayed.\r\n\r\nBut according to Meteor document, helpers is a reactive computation, and Database queries on Collections is  reactive data source. So after `Roles` is ready, the `{{#with allRoles}}` is reactive and should be displayed.\r\n\r\nWhy does roles not be displayed?\r\n\r\nAnd then I rewrite my code to:\r\n\r\n     Meteor.startup(function() {\r\n           if(Meteor.isClient) {\r\n            roles_sub = Meteor.subscribe('Roles');\r\n           }\r\n         });\r\n    \r\n    Template.roles.helper(function() {\r\n           allRoles: function() {\r\n             console.log(2);\r\n             return Roles.find();\r\n           },\r\n           isReady: function() {\r\n             console.log(1);\r\n             console.log(roles_sub.ready());\r\n             return roles_sub.ready();\r\n           }\r\n         })\r\n\r\nhtml\r\n\r\n    <template name=\"roles\">\r\n      <div>\r\n        {{#if isReady}}\r\n        {{#with allRoles}}\r\n          <label>{{> role }}</label>label>\r\n        {{/with}}\r\n        {{/if}}\r\n      </div>div>\r\n    </template>template>\r\n\r\n\r\n\r\nAnd still role labels cannot be displayed.\r\nAnd console gives me:\r\n\r\n    1\r\n    false\r\n    1\r\n    false\r\n    1\r\n    true\r\n    2\r\n\r\nWhich means `isReady()` is reactive? but why my roles labels remains blank?\r\n\r\nCan somebody explain this?"},"comment":{"url":"https://api.github.com/repos/meteor/meteor/issues/comments/104554235","html_url":"https://github.com/meteor/meteor/issues/4429#issuecomment-104554235","issue_url":"https://api.github.com/repos/meteor/meteor/issues/4429","id":104554235,"user":{"login":"KristerV","id":2750622,"avatar_url":"https://avatars.githubusercontent.com/u/2750622?v=3","gravatar_id":"","url":"https://api.github.com/users/KristerV","html_url":"https://github.com/KristerV","followers_url":"https://api.github.com/users/KristerV/followers","following_url":"https://api.github.com/users/KristerV/following{/other_user}","gists_url":"https://api.github.com/users/KristerV/gists{/gist_id}","starred_url":"https://api.github.com/users/KristerV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KristerV/subscriptions","organizations_url":"https://api.github.com/users/KristerV/orgs","repos_url":"https://api.github.com/users/KristerV/repos","events_url":"https://api.github.com/users/KristerV/events{/privacy}","received_events_url":"https://api.github.com/users/KristerV/received_events","type":"User","site_admin":false},"created_at":"2015-05-22T07:48:10Z","updated_at":"2015-05-22T07:48:10Z","body":"instead of `.helpers(function(){})` try `.helpers({})`\r\n\r\nBut really, you should ask questions in stackoverflow. This place is for reporting actual issues concerning meteor itself."}}