This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Sigurd Tapio Mannsåker
Posted Apr 09 - Read on Facebook

Hi guys, quick question: is there a way to reference a global variable from within a module? Say I declare foo = true in app.coffee, I don't appear to be able to use window.foo from modules/Bar.coffee for example. Any ideas?

1 Comments

Kevyn Arnott

It's not possible through a module referencing an app.coffee variable. You can however store the variable in the module and reference it in both the app.coffee and module. So in the module write: "exports.moo = true", and then you can manipulate that in the app.coffee with "module.moo." Hopefully, that helps!

Read the entire post on Facebook