Hi ,
In our process to learn Angular2 . we are trying to use api done by marvel
. The access to this api is done with hash key that we need to send to the
api
but we don't really know how to implement
On the running process we the error ;. "require is not defined"
Here is the piece of code ;
generateMarvelAccessUrl(baseurl: string) {
var CryptoJS = require("crypto-js");
var PRIV_KEY = "mypublickey";
var API_KEY = "myprivatekey";
var url = baseurl + "?limit=100&apikey=" + API_KEY;
var ts = new Date().getTime();
var hash = CryptoJS.createHash('md5').update(ts + PRIV_KEY +
API_KEY).digest('hex');
url += "&ts=" + ts + "&hash=" + hash;
return url;
}
Is someone may help us on that .
We are new on angular 2
Regards
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.