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

What is Framer? Join the Community
Return to index
Jason Nelson
Posted Jul 02 - Read on Facebook

Is it possible to call a function within a module that is defined in your primary app.coffee file?

I've got a piece of modular UI that I'd like to be able to call a function in the parent document.

Thanks in advance!

7 Comments

Jordan Robert Dobson

You could always pass it into your module... Or I think use window.myFunction to call it.

Jason Nelson

Jordan Robert Dobson, how would I go about doing that? I understand how to pass variables...

Jordan Robert Dobson

A function is much like variable. Instead of holding a value it holds some code to execute.

Jordan Robert Dobson

So instead of calling the function like myFunc()... Pass it as myFunc as an argument of function inside your module.

Jordan Robert Dobson

Then call that argument from inside module function.

Jason Nelson

Thanks, Jordan! I was able to figure out how to pass the function using parameters.

Jordan Robert Dobson

Awlsum!

Read the entire post on Facebook