LT-253: Creating dynamic form components

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2016-07-22 11:12:04 +02:00
1 parent 88f737644f
commit cb875b1913
72 files changed
+1169 -126

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
import { Template } from 'meteor/templating';
import { Session } from 'meteor/session';
import { ReactiveVar } from 'meteor/reactive-var';
/**
* Global Blaze UI helpers to work with Blaze
*/
// Return the current template instance
Template.registerHelper('instance', () => {
return Template.instance();
});
// Return the session value for the given key
Template.registerHelper('session', key => {
return Session.get(key);
});
// Return the value for given parameter regardless if it's reactive or not
Template.registerHelper('reactive', parameter => {
if (parameter instanceof ReactiveVar) {
return parameter.get();
}
return parameter;
});