0

OK, this is pretty basic question, but I cannot figure this out... What is the correct way to call functions from modules? The way I do it is:

main.opa:

function start(){
    Page.page();
}

Server.start(
    Server.http, 
    [
        {title: "Calculator", page: start}
    ]
);

Where in the other, page.opa file I have:

module Page {
    function page(){
         <p>Consider this as html block...</p>
    }
}

Now, the error I get is that Page variable is unbound (it's not a variable at all!). Both files are in the same location.

user1548072
  • 478
  • 1
  • 6
  • 9

1 Answers1

1

How you compile your application? The following command should well works

opa page.opa main.opa

Then run the produced JavaScript file as an executable

./main.js

Or use the "--" option of the Opa compiler to compile and run

opa page.opa main.opa --