2016-02-27

Meteor - How to test and add CLIENT properties to Meteor.settings (settings.json startup config file)

Place this inside any of your templates, or add the main statements to an existing event.

Template.body.onRendered(function () {

    // Reading from settings.json
    console.log(
        Meteor.settings.public.EXISTING_PROPERTY_NAME
    );

    // Adding a variable/object
    Meteor.settings.public.NEW_PROPERTY_NAME = 'PROPERTY-CONTENT';
    console.log(
        Meteor.settings.public.NEW_PROPERTY_NAME
    );

});//rendered

No comments:

Post a Comment