meteor-blaze

Running a function AFTER a meteor template is updated

浪子不回头ぞ 提交于 2019-12-03 13:45:35
I have a meteor template rendering some html that I need to perform a jquery function on. Right now, I've set up a dependency so that every time the data (a list of objects) tied to that template changes, the function runs. I'm not at all sure this is the best way to do what I'm trying to do, but it does run the function every time I add/delete/rearrange objects, so that's a start. However , the function seems to be running before the template is re-rendered, so the previous set of blocks get jquery-fied, but any blocks I've just added on that action do not. Is there a way to force a function

event.target is undefined in events

戏子无情 提交于 2019-12-03 11:14:06
How can one use each input values in events ? Hope my below code will explain you well. HTML: <template name="UpdateAge"> {{#each Name}} <div data-action="showPrompt"> <div> Some content </div> <div> <div> Some content </div> </div> <div> Name : {{name}} Age : <input type="text" name="age" value="{{age}}"/> //I need to access age values in event </div> </div> {{/each}} <template> JS: Template.UpdateAge.events({ 'click [data-action="showPrompt"]': function (event, template) { console.log(event.target.age.value); // TypeError: event.target.age.value is undefined } }); I dont know whether my

Page transitions in meteor?

醉酒当歌 提交于 2019-12-03 09:29:25
I've got a meteor mobile app structurally working; I really need to stitch the views together with some page transitions. I looked at the iron-transitioner project but it looks like development has ceased? (last commit 6 months ago, still using Spark engine) I've also looked at a few UI 'mobile frameworks' (Ratchet, Framework7) but I couldn't get them to play nicely with the meteor server. I'm wondering if anyone knows of any other simple (left/right) page transition package / script that I could try? It's just to give my UI some (expected) slickness really. What about some jQuery with

Meteor #each loop ready

白昼怎懂夜的黑 提交于 2019-12-03 08:57:25
I wonder is there any way to know if #each loop is "ready". By "ready" I mean it rendered all nodes and inserted into the DOM. I don't even speak about onRendered callback (old rendered ). I tried <template name="myTemplate"> <div class="some-class"> {{#if Template.subscriptionsReady}} {{#each messages}} <div>{{text}}</div> {{/each}} <script> $(".some-class").trigger("LOOP_READY") </script> {{/if}} </div> </template> Template.myTemplate.onRendered(function(){ this.$(".some-class").on("LOOP_READY", doSomething) }) But it does not work either. I don't want to use timers. UPDATE messages is a

How do Meteor's blaze and Famo.us play together?

廉价感情. 提交于 2019-12-03 06:04:52
问题 2 Technologies: Meteor with the blaze templating engine Famo.us with their awesome gui framework I come from the meteor side, I personally like using {{mustache}} (handlebars) to drive the gui from data, the reactive session / database makes this really efficient and intuitive. Now came famo.us and all its advantages, but the drawback of a code based gui is that there is no place for handlebars anymore… What is the current practice for mixing both technologies together ? Are they completely

Meteor Dropdown list get and set

女生的网名这么多〃 提交于 2019-12-03 04:33:19
What is the best way to get and select values from a dropdown list (and also in radio) in Meteor. I have created a helper: Template.categories.helpers({ categories: ["facebook", "news", "tv", "tweets"] }); and in html ... <select class="form-control" id="category"> {{> categories}} </select> ... <template name="categories"> <option disabled="disabled" selected="selected">Please Select</option> {{#each categories}} <option value="{{this}}">{{this}}</option> {{/each}} </template> In case of edit, I would like to evaluate it with value coming from database (e.g. news) to be selected. Thanks in

Meteor callback when a template has been re-rendered

一个人想着一个人 提交于 2019-12-03 03:46:57
I currently have a template that has an {{#each}} loop within in it. I am trying to find a way to fire off a specific function whenever that {{#each}} loop has finished. Template.rendered only runs when the template has been rendered for the first time, so that doesn't work unfortunately. Is there anything out there that can do this? This is how I would do it : Template.foo.rendered=function(){ // NEW in 0.8.3, use this.computation=Deps.autorun and // this.computation.stop() in destroyed callback otherwise this.autorun(function(){ var cursor=Foo.find({/* same query you feed the #each with */})

Blaze template iterate over object

梦想与她 提交于 2019-12-02 22:42:41
问题 I am trying to iterate over an object in blaze template (meteor) , in console I can see the data but nothing on template.How can I get this working ? #each not working , arrayify also didn't work. Added here from comments: {{#each contactList}} <tr class="clickable" name="edit-contact" > <td>{{name}} </td> <td>{{email}} </td> <td>{{title}}</td> <td>{{phone1}}</td> <td>{{phone2}}</td> <td>{{phone3}}</td> </tr> {{/each}} JS: contactList: function() { $.ajax({ url: Meteor.absoluteUrl()+'contacts

How do Meteor's blaze and Famo.us play together?

折月煮酒 提交于 2019-12-02 19:32:09
2 Technologies: Meteor with the blaze templating engine Famo.us with their awesome gui framework I come from the meteor side, I personally like using {{mustache}} (handlebars) to drive the gui from data, the reactive session / database makes this really efficient and intuitive. Now came famo.us and all its advantages, but the drawback of a code based gui is that there is no place for handlebars anymore… What is the current practice for mixing both technologies together ? Are they completely dissociative ? Is using the "observe" / "Deps.autorun" mechanism a common practice everywhere a famo.us

Meteor: “=> Exited with code: 8” error

社会主义新天地 提交于 2019-12-02 16:21:40
问题 Just getting started with Meteor, following the tutorial presented in Discover Meteor . After implementing code from Chapter 3, I kept getting the following error: W20150714-18:47:36.539(-7)? (STDERR) W20150714-18:47:36.540(-7)? (STDERR) /Users/TXC/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245 W20150714-18:47:36.540(-7)? (STDERR) throw(ex); W20150714-18:47:36.540(-7)? (STDERR) ^