How to use the meteor/templating.Template.instance function in meteor

To help you get started, we’ve selected a few meteor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OHIF / Viewers / Packages / worklist / client / components / serverInformation / serverInformationForm / serverInformationForm.js View on Github external
Template.serverInformationForm.onRendered(() => {
    const instance = Template.instance();

    instance.data.$form = instance.$('form:first');
    instance.data.form = instance.data.$form.data('component');

    // Handle the server type
    instance.autorun(() => {
        // Get the server type component
        const typeComponent = instance.$('[data-key=type] :input').data('component');

        // Run this computation every time the user change the server type
        typeComponent.depend();

        // Get the current server type value
        const type = typeComponent.value();

        // Set the serverType reactive value
github DemocracyEarth / sovereign / imports / ui / templates / components / identity / avatar / avatar.js View on Github external
getImage(pic) {
    return getImage(Template.instance().imageTemplate.get(), pic);
  },
});
github Swydo / blaze-apollo / lib / setup.js View on Github external
  Template.registerHelper('queriesReady', () => Template.instance().queriesReady());
}
github radgrad / radgrad / app / imports / ui / components / student / student-about-me-widget.js View on Github external
email() {
    if (getRouteUserName()) {
      return Template.instance().data.student.username;
    }
    return '';
  },
  interests() {
github RocketChat / Rocket.Chat / app / ui-flextab / client / tabs / membersList.js View on Github external
} else {
						utcOffset = `(UTC ${ utcOffset })`;
					}
				}
			}

			return {
				user,
				status: (onlineUsers[user.username] != null ? onlineUsers[user.username].status : 'offline'),
				muted: Array.from(roomMuted).includes(user.username),
				utcOffset,
			};
		});

		const usersTotal = users.length;
		const { total, loading, usersLimit, loadingMore } = Template.instance();
		const hasMore = loadingMore.get() || (usersTotal < total.get() && usersLimit.get() <= usersTotal);
		const totalShowing = usersTotal;

		return {
			_id: this.rid,
			total: total.get(),
			totalShowing,
			loading: loading.get(),
			totalOnline,
			users,
			hasMore,
			rid: this.rid,
		};
	},
github radgrad / radgrad / app / imports / ui / pages / admin / admin-database-restore-page.js View on Github external
hidden() {
    const data = Template.instance().results.get();
    return (data) ? '' : 'hidden';
  },
  restoreDate() {
github topogram / topogram / imports / ui / pages / import.js View on Github external
isEdges: function() {
        return Template.instance().newLayerType.get() === 'edges' && Template.instance().newLayerDataReady.get()
    },
    isNodes: function() {
github RocketChat / Rocket.Chat / app / livechat / client / views / app / tabbar / visitorEdit.js View on Github external
email() {
		const visitor = Template.instance().visitor.get();
		if (visitor.visitorEmails && visitor.visitorEmails.length > 0) {
			return visitor.visitorEmails[0].address;
		}
	},
github radgrad / radgrad / app / imports / ui / components / admin / list-help-messages-widget.js View on Github external
helpMessages() {
    const items = HelpMessages.find({}, { sort: { routeName: 1 } }).fetch();
    const startIndex = Template.instance().itemIndex.get();
    const endIndex = startIndex + Template.instance().itemCount.get();
    return _.slice(items, startIndex, endIndex);
  },
  count() {