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

What is Framer? Join the Community
Return to index
Rohan K
Posted Jan 09 - Read on Facebook

I've created a class in which I am referencing layers / objects / variables in the main project. it was working fine when the class definition was as part of the project, but stopped working when I made a module out of it. I am using exports.classname when defining the class, is there anything else that I should be doing?

3 Comments

Jordan Robert Dobson

It's all scopes to that module now. So you have to pass anything you want through a function or a shared module variable.

Rohan K

thats a bummer, i was really hoping to share this module with others at my workplace. So how do I create a shared module variable?

Jordan Robert Dobson

Create a generic object that gets exported and included in every module.

I use exports.$ = {}

And then I import that in every module as well as app.coffee

Read the entire post on Facebook