有没有办法将@capacitore/core 导入angularJS 控制器?

Is there a way to import @capacitore/core into an angularJS controller?

import {Plugins, CameraResultType} from '@capacitor/core';         <===============

angular.module('settings.ctrl', ['mn']);
angular
  .module('settings.ctrl')
  .controller('settingsCtrl', function (

我正在尝试使用内置于@capacitor/core 中的相机 API,但无论我如何尝试导入 API,我都会继续遇到相同的错误:

错误:

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)

我是 AngularJS 的新手,也使用 Capacitor,所以我很好奇是否真的有任何方法可以做到这一点,或者它们是否以这种方式不兼容。任何帮助或引导都会很好。

更新: 我已经尝试使用 browserify per https://forum.ionicframework.com/t/using-capacitor-apis-with-ionic-v1/175257 唯一的问题是它给了我插件(相机是我需要的)但是生成的文件中的任何地方都不包含 CameraResultType,这意味着我无法获得返回照片的数据并用它做任何事情。

节点模块:

+-- @capacitor/cli@2.4.5
+-- @capacitor/core@2.4.7
+-- android@0.0.8
+-- android-sdk-client@1.2.5
+-- angular@1.8.2
+-- browserify@17.0.0
+-- capacitor-resources@2.0.5
+-- cordova-res@0.15.3
+-- cordova-res-generator@0.4.2
+-- gulp@4.0.2
+-- ionic@5.4.16
+-- native-run@1.3.0
+-- nodejs@0.0.0
+-- nvm@0.0.4
`-- yarn@1.22.10

事实证明,我试图获取的枚举只不过是一个字符串,所以我能够将它硬编码进去,而不是使用 CameraResultType.Uri

      try {
        // Take/Select Photo
        var image = await Camera.getPhoto({
          quality: 100,
          resultType: "uri"
        });
        // imageURL contains path that can be set as img src
        onPhotoURISuccess(image.webPath);
      } catch (e) {
        console.error('Error Getting Photo: ', e);
      }