How to include and use node modules in your Ionic / AngularJs app?

后端 未结 3 651
广开言路
广开言路 2020-12-14 16:36

I have an Ionic app and I\'d like to include the node module angular-base64 to use in my controllers, or even wrap inside an angular service etc. I\'ve gone ahead and ran

3条回答
  •  情深已故
    2020-12-14 16:57

    • Place the directory angular-base64/angular-base64.min.js in www/lib.

    • Include the JS file in index.html (for example: .

    • Inject the module in app.js: angular.module('starter', ['base64']).

    Afterwards you should be able to use base64 everywhere in your app.

提交回复
热议问题