iron router - Meteor client side collection needs to have all data populated before anything else -
I'm trying to use the client side store as a site configuration system. I incorporate the documents representing my various pages, and using the It all works great, when all the data is loaded. When I restart the app on some pages, the data is not loaded yet, and I get an exception from the Here is my javascript: console and second time like this: So the router is just trying to load this data very quickly. I have put the process of loading code into different files in my code, including Normal How can I ensure that this information has already been released? unchecked, but copy: return a subscription handle, Or with any In addition to this, it is better to use and adjust your iron-router and navigation tabs, they use all to determine which pages they are and their Which templates are presented by each page a
{{& gt; ContentTemplate}} The Insertion Assistant has to load this relevant template.
Dipes Recomputing Function: Error: Expected faucet or template was found in exchange for the included function: Undefined < / code> error.
Storyrere = [{Category: 'Teaching', Content Template: 'teachingHome', Title : 'Teaching Home'}, ...]; Stories = New Meteor. Compile (empty); Story More Year (function (story, index) {story._id = index + ''; storyjinst (story);}); // in main.js Template.teachingPost.contentTemplate = function () {console.log (this); Console.log (this.contentTemplate); Return template [this.contentTemplate]; }; // in router.js this.route ('teaching', {layoutTemplate: 'teachingPost', data: function () {back stories.fundon ({content title: 'teaching home', category: 'teaching'})}} }); Log on twice to
contentTemplate assistant, for the first time in this form:
object {} main JS? 1f560c50f23d9012c6b6dd54469bb32b99aa4285: 45 undefined main.js? 1f560c50f23d9012c6b6dd54469bb32b99aa4285: 46
object {category: "teaching", contentTemplate: "teaching home", title: "Teaching Home "} main. Js? 1f560c50f23d9012c6b6dd54469bb32b99aa4285: 45th Home of Education: JS? 1f560c50f23d9012c6b6dd54469bb32b99aa4285: 46
lib , and even so That it is
Meteor.startup , but it is always the same result.
iron-router
wait /
subscription pattern does not really apply here because it is a client side The memory which is w ith
null , which has no server representation, I do not want to for the representation of the server, because it is the static content that no need to go to my server is not.
ready to the
ready method, any task will add the handle to a waiting list.
find with
data ,
findOne As
Find the collection is empty when an empty cursor will return, as opposed to
findOne return
undefined . Then try it:
Template.teachingPost.contentTemplate function to work with the cursor instead of the object.
Comments
Post a Comment