meteor-blaze

Polymer 1.0 default icon set in iron-icons not working using blaze (meteor) templating engine

♀尐吖头ヾ 提交于 2019-11-29 18:24:35
问题 After upgrading to Polymer 1.0, default iron-icons set is not working. I am trying to use home icon from the default icon set. HTML code fragment: <link rel="import" href="/components/iron-flex-layout/classes/iron-flex-layout.html"> <link rel="import" href="/components/iron-icons/iron-icons.html"> <link rel="import" href="/components/iron-icons/communication-icons.html"> <link rel="import" href="/components/iron-form/iron-form.html"> <link rel="import" href="/components/iron-selector/iron

How do I use X-editable on dynamic fields in a Meteor template now with Blaze?

此生再无相见时 提交于 2019-11-29 15:14:00
问题 I had x-editable working in Meteor 0.7.2 but since upgrading to 0.8.0 it no longer renders correctly. I tend to end up with a bunch of Empty tags. This is frustrating because the data is there, just not by the time the rendered function is fired. <template name="clientPage"> <header>{{> clientPageTitleUpdate}}</header> </template> <template name="clientPageTitleUpdate"> <h1><span class="title-update editable" data-type="text" data-pk="{{_id}}" data-name="title" data-value="{{title}}">{{title}

Meteor: Forcing rerendering whole template after collection update with Blaze

寵の児 提交于 2019-11-29 06:57:24
I have a template in which the DOM is changed, and I would like to rerender the template when saving to database. Before Blaze, Meteor would have rerendered the whole template if there was a reactive variable somewhere in the template, but now how can I do this ? I have a collection of clips set up in an Iron router route : ClipsController = RouteController.extend({ data: function() { clips = Clips.find({}, {sort: {created: 1}}); return {clips: clips}; } }); And a template for clips : <template name="clips"> {{#each clips}} {{> clip}} {{/each}} </template> Then, I have a template for clip :

Meteor package, how to add static files

只谈情不闲聊 提交于 2019-11-29 00:29:47
问题 I'm creating a package and, for the client side, I need to add some static files like fonts and images. After trying some outdated solution I found nothing seemed to work for me. How should I add those files? Create a public folder inside my package? Adding the files with api.addFiles ? Is this even possible? 回答1: update: meteor 1.2 You should now use api.addAssets to add static files to your package. original answer You can add static assets to any package and they will be served by meteor.

meteor js iron router: apply CSS change whenever route changes

末鹿安然 提交于 2019-11-28 09:28:32
I have homepage, contact page, and several other product related pages in my app. The goal is to apply a background image to ONLY specifc routes: /homepage and /contact . If user navigates away from either route, apply some css change. I am hacking this together now with a helper on my homepage, like so: Template.homepage.rendered = function () { var route = Router.current(); if ( route.path == '/' ) { document.body.className = "showBackgroundImage"; } }; Partial win here, since this will activate the css, but I need to deactivate when route changes. I have also tried the following within my

Meteor: Access Template Helper (or variable) from another helper

蹲街弑〆低调 提交于 2019-11-28 08:12:05
How can I reference a template helper from another one? For example... Template.XXX.helpers({ reusableHelper: function() { return this.field1 * 25 / 100; //or some other result }, anotherHelper: function() { if (this.reusableHelper() > 300) //this does not work return this.reusableHelper() + ' is greater than 300'; else return this.reusableHelper() + ' is smaller than 300'; } }); I have also tried Template.instance().__helpers.reusableHelper - all with no luck. Alternatively is there a way to define reactive Template instance variables? XXX is a sub-template that renders multiple times on the

Meteor: Forcing rerendering whole template after collection update with Blaze

落花浮王杯 提交于 2019-11-28 00:35:03
问题 I have a template in which the DOM is changed, and I would like to rerender the template when saving to database. Before Blaze, Meteor would have rerendered the whole template if there was a reactive variable somewhere in the template, but now how can I do this ? I have a collection of clips set up in an Iron router route : ClipsController = RouteController.extend({ data: function() { clips = Clips.find({}, {sort: {created: 1}}); return {clips: clips}; } }); And a template for clips :

Meteor 0.8 Blaze how to update rendered changes for Jquery plugins

▼魔方 西西 提交于 2019-11-27 03:47:18
问题 My question is how to get 1 event or rendered callback when a group of elements are updated in the DOM? If I follow the link in the Blaze wiki https://github.com/avital/meteor-ui-new-rendered-callback this is not what I want. If I follow the second recommendation, I will get as many rendered calls as I have elements. And the parent element will only get 1 rendered callback on page load. In my case, I'm using the Footable Jquery plugin to format a table. The initial load works fine, but if I

Meteor: Access Template Helper (or variable) from another helper

一世执手 提交于 2019-11-27 02:11:56
问题 How can I reference a template helper from another one? For example... Template.XXX.helpers({ reusableHelper: function() { return this.field1 * 25 / 100; //or some other result }, anotherHelper: function() { if (this.reusableHelper() > 300) //this does not work return this.reusableHelper() + ' is greater than 300'; else return this.reusableHelper() + ' is smaller than 300'; } }); I have also tried Template.instance().__helpers.reusableHelper - all with no luck. Alternatively is there a way to

How to get the parent template instance (of the current template)

那年仲夏 提交于 2019-11-26 18:23:44
问题 Is there a clean way to get the parent template of the current template? Nothing is officially documented in Meteor's API. I'm talking about the Blaze.TemplateInstance , not the context (i.e. not Template.parentData ). 回答1: In the end, I've extended the template instances similarly with Meteor's parentData, like this: /** * Get the parent template instance * @param {Number} [levels] How many levels to go up. Default is 1 * @returns {Blaze.TemplateInstance} */ Blaze.TemplateInstance.prototype