Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Passing in a param that can be read in code at run time
dwaxman last edited by
I have some code blocks that I would like to ignore when my project is run from Monaca Preview or Debug - what is the correct way to either know this from an existing value or pass in a value on my command line that can be read in my code.
You cannot really pass any parameter but there are alternative ways to check if you are running Monaca Preview or a Debug build.
During Monaca Preview execution, Cordova itself is not running. You can just check that and adapt your code consequently. Here you can find some examples.
For what concerns Debug builds, you can check it by using a Cordova Plugin like this one