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

What is Framer? Join the Community
Return to index
Nikolay Berezovskiy
Posted Feb 03 - Read on Facebook

Hi, guys. Who knows how to call some part of a composite class from another module?

For example, I have to call an icon from a header and detect their events.


Sergey Voronov

exports.header.iconLeft=iconLeft=new Layer

Sergey Voronov

class Bla extends Layer
constructor: (options={}) ->
super options
childLayer=new Layer
blabla=new Bla
print blabla.child

Anton Kartashov

I can rrrecommend you this video my rrrussian friend:

Jordan Robert Dobson

I would just assign it to a global variable. And share it that way.

Sergey Voronov

Its in the class, so each child of new element of the class should be accessible, that was the idea

Jordan Robert Dobson

Well if you include a global var across all modules it makes it much easier.

I typically have a global module that gets included / requires everywhere.

It starts out as $ = {}

And gradually

$.color =
orange: "#ff3300"
gray50: "#808080"

$.layer =
iconLeft: null

Then in another module

$.layer.iconLeft = new Layer ....

And then you're golden!

Read the entire post on Facebook