Global variables in Meteor

前端 未结 4 1337
傲寒
傲寒 2020-11-29 03:28

I have

var Schemas = {};

Meteor.isClient && Template.registerHelper(\"Schemas\", Schemas);

Schemas.Person = new SimpleSchema({
  fullName: {
    ty         


        
4条回答
  •  清歌不尽
    2020-11-29 04:09

    Variables in Meteor declared with the var keyword are scoped to the file they are declared in.

    If you want to create a global variable do this

    Schemas = {}
    

提交回复
热议问题