Ladislav M
Ladislav M

Reputation: 2187

Cordova environments

Is there a way how to distinguish between an package that is running from local machine and the on that was installed from store in the Cordova app?

For example I'd like to have a JavaScript variable called 'evn' set like this:

if(cordovaLocal){
env = 'dev';
} else{
env = 'live';
}

Suppose that value of cordovaLocal variable would be set by some plugin or cordova method, that returns boolean depending on whether package is installed from store or not.

Upvotes: 2

Views: 175

Answers (1)

krik
krik

Reputation: 539

You can set up your Grunt/Gulp to generate an AngularJS constant specifying the build environment:

Upvotes: 1

Related Questions