Tuesday, 6 June 2017

Injector error in Angular.js when using CryptoJS

I try to use cryptojs, but i keep getting injector error. My app.js

angular.module('myApp',[
'chart.js',
'crypto-js' ]);

I have a factory where i want to make a handshake and i need a sha1 encryption here.

fac.getData = function () {
    var requestTime = new Date().getTime() / 1000 + "";
    var handshake = CryptoJS.AES.Sha1("OurYourpayHandshake" + requestTime); } return fac; });

in my index i have put in

<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/sha1.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"></script>

and this is my structure of the project Structure of app

this is the errors i get Error messages i get in developer tool

What am i doing wrong and can you give examples? Im tired of working with cryptojs now have tried for hours and hours.



via Thomas Staal

No comments:

Post a Comment