javascript - ngCordova not recognising Camera, Flashlight, or other parts of Android Phone -
I'm trying to use an app, and
I get it
cordova plugin add org.apache.cordova.camera is the example code from the docs included in my main controller :
var Options = {Quality: 75, Destination Type: Camera. DATA_URL, source type: camera. Picture Type the source, Allow Edit: True, Encoding Type: Camera. Type encoding. JPEG, TargetWidth: 100, TargetHight: 100, PopOver Option: CameraPopord Option, Setofota Album: False}; $ CordovaCamera.getPicture (options) .then (function (imageData) {// success! Image data is here}, function (mistake) {// an error occurred} Show a message to the user}); I then add Android as an platform to add Android as an eonistic platform, then its LG G2 phone is connected via USB, while "Ionic Run" Run the app on my phone while using The problem is, it does not work I get the following error:
Reference: camera new & lt; Anonymous & gt; Not defined (File: ///android_asset/www/js/app.js: 36: 45) On invoice (file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 11591: 17) In the .instantiate (file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 11602: 23) file on the file: /// android_asset / www / lib / ionic / js / ionic. Bundle.js: 14906: 28 on file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 14295: for for 34 (file: /// android_asset / www / lib / ionic / js / Ionic.bundle JS: 7957: 20) Composite links on nodelinkfane (file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 14282: 11) (file: ///Android_set / www / Lib / Ionic / Js / ionic.bundle.js: 13730: 13) Composite Linkf (File: /// android_asset / www / lib / io PublicLinkFN (file: /// and Android / Asset / Www / lib / ionic / js / ionic.bundle.js: 13626: 30) To find out whether this was completely wrong with NGO Cordova, or just specifically the camera function, I also tried to work with torch by the same step and the example of torch Example code used:
var isvaila Ble = $ cordovaFlashlight.available ()
$ cordovaFlashlight.switchOn (). Then (function (success) {/ * success /}, function (error) {/ error *
when I try to run it, I get a similar error .
TypeError: unavailable "flashlight" property on object can not be read. (File: ///android_asset/www/lib/ngCordova/dist/ng-cordova.js: 1243: 23) New & lt; Anonymous & gt; (File: ///android_asset/www/js/app.js: 36: 42) On Invoice (File: /// android_asset / www / lib / ionic / js / ionic Bundle.js: 11591: 17) .instantiate on the object (file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 11602: 23) in file: /// android_asset / www / lib / Ionic / js / ionic Bundle.js: 14906: 28 on file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 14295: for for 34 (file: /// android_asset / www / lib / ionic / js / Ionic.bundle JS: 7957: 20) Composite links on nodelinkfane (file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 14282: 11) (file: ///Android_set / www / Lib / Ionic / js / ionic.bundle.js: 13730: 13) Composite lymphs (file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 13733: 13) Does anyone know what's going on? I think I have followed the steps outlined in the documents correctly.
(As a prudent inquiry, I tried to log in to the value of the window, to check that there really existed. It is interesting that Cordova.plugins property is an object In which there is only "keyboard" property. I used to expect that it would also have some type of reference for a camera and torch. Maybe it is something with the problem?) < P>
You may also like the Cordova Flashlight plugin A should be a reference like the following example
module.transformer ('MyController', function ($ radius, $ cordova flashite) {
Comments
Post a Comment