angular js with phonegap? Test for environment