There is a functions.js file located in src/lib/ and there is a function in it. That file has been included into slug.json.
How could we call that function inside the controller?
There is a functions.js file located in src/lib/ and there is a function in it. That file has been included into slug.json.
How could we call that function inside the controller?
Copyright © 2021 Jogjafile Inc.
In coffeescript each file is wrapped with an anonymous function to avoid leaking into global scope. If you want to leak into global scope on purpose, you need to put the function in "window":
You can then call the function in the controller as "check_pants", that is to say that callers don't need to include "window".
Since "this" refers to window by default, you can use an "@" sign: