Attempting to integrate the stripe-angular
module into my Ionic/AngularJS application.
https://github.com/gtramontina/stripe-angular
I have installed the module using npm install stripe-angular
.
This is how I include the dependency in my app:
var myApp = angular.module('myApp',
['ionic','ionic.utils','stripe','google.maps','myApp.controllers','myApp.services'])
.config(function($stateProvider, $urlRouterProvider, stripeProvider) {
stripeProvider.setPublishableKey('pk_test_APIKEY');
});
Even without injecting the dependency into any controllers or services, I encounter the following console error:
Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:unpr] Unknown provider: stripeProvider
http://errors.angularjs.org/1.2.25/$injector/unpr?p0=stripeProvider
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:7703:12
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:11427:19
at getService (http://localhost:8100/lib/ionic/js/ionic.bundle.js:11555:39)
at Object.invoke (http://localhost:8100/lib/ionic/js/ionic.bundle.js:11582:13)
at http://localhost:8100/lib/ionic/js/ionic.bundle.js:11510:37
at forEach (http://localhost:8100/lib/ionic/js/ionic.bundle.js:7950:18)
at loadModules (http://localhost:8100/lib/ionic/js/ionic.bundle.js:11497:5)
at createInjector (http://localhost:8100/lib/ionic/js/ionic.bundle.js:11437:11)
at doBootstrap (http://localhost:8100/lib/ionic/js/ionic.bundle.js:9069:20)
at bootstrap (http://localhost:8100/lib/ionic/js/ionic.bundle.js:9084:12)
http://errors.angularjs.org/1.2.25/$injector/modulerr?p0=myApp&p1=Error%…%3A%2F%2Flocalhost%3A8100%2Flib%2Fionic%2Fjs%2Fionic.bundle.js%3A9084%3A12)
Here's the relevant part of my index.html
file:
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<script src="js/services.js"></script>
Am I making a mistake with my dependency injection or overlooking something? Detailed explanations would be greatly appreciated. Thank you!