import {Plugins, CameraResultType} from '@capacitor/core'; <===============
angular.module('settings.ctrl', ['mn']);
angular
.module('settings.ctrl')
.controller('settingsCtrl', function (
I've been attempting to utilize the @capacitor/core Camera API without success. No matter how I attempt to import the API, I consistently encounter the following error:
Error:
capacitor-runtime.js:358 SyntaxError: Cannot use import statement outside a module
capacitor.handleError @ capacitor-runtime.js:358
settings.ctrl.js:68 Uncaught SyntaxError: Cannot use import statement outside a module
capacitor-runtime.js:358 Error: [$injector:modulerr] Failed to instantiate module firefly due to:
Error: [$injector:modulerr] Failed to instantiate module settings.ctrl due to:
Error: [$injector:nomod] Module 'settings.ctrl' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.4.3/$injector/nomod?p0=settings.ctrl
at http://localhost/lib/ionic/js/ionic.bundle.js:13380:12
at http://localhost/lib/ionic/js/ionic.bundle.js:15270:17
at ensure (http://localhost/lib/ionic/js/ionic.bundle.js:15194:38)
at module (http://localhost/lib/ionic/js/ionic.bundle.js:15268:14)
at http://localhost/lib/ionic/js/ionic.bundle.js:17674:22
at forEach (http://localhost/lib/ionic/js/ionic.bundle.js:13648:20)
at loadModules (http://localhost/lib/ionic/js/ionic.bundle.js:17658:5)
at http://localhost/lib/ionic/js/ionic.bundle.js:17675:40
at forEach (http://localhost/lib/ionic/js/ionic.bundle.js:13648:20)
at loadModules (http://localhost/lib/ionic/js/ionic.bundle.js:17658:5)
I am relatively new to AngularJS and Capacitor, so I'm unsure if there's a way to resolve this issue or if they are simply incompatible in this scenario. Any guidance would be greatly appreciated.
UPDATE: I have attempted using browserify based on . However, the problem with this approach is that while it provides me with the plugins (specifically the Camera plugin I need), the generated file does not include CameraResultType anywhere, making it impossible for me to retrieve and manipulate the photo data.
NODE MODULES:
+-- @capacitor/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4b2827220b79655f657e">[email protected]</a>
+-- @capacitor/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9bf8f4e9fedba9afb5ac">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7617181204191236465846584e">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="89e8e7edfce6eda4faede2a4eaede0ece7dcc9b8bcbba7bc">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a1c0cfc6dcd3e1908f998f93">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ec8e9e839b9f899e858a95acdddbc2dcc2dc">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="96f5f7e6f7ffe2f9e4bbe4f3e5f9e3e4f5f3e5d6a4b8a6b8a3">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bcdfd3ced3ddecee9e809e809e">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="04676b766b7265297661772963616a617665700b7644342a302a36">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="98ffedf4e8d8acb6a8b6aa">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="046d6b6a6d6744312a302a3532">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0e606f71673f203d203e">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="aec0c1cacbc4ee80809e">[email protected]</a>
+-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f39d859eb3c3ddc3ddc7">[email protected]</a>
`-- <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="95ecf4e7fbd5a4bba7a7bba4a5">[email protected]</a>