Recently, I've encountered an issue while working with Typescript and angular 2. I have built an EncryptionService that looks like this:
import {Injectable} from 'angular2/core';
import './lib/hmac256-enc64';
@Injectable()
export class EncryptionService {
constructor() {
}
hmacSha256(message: string, secret: string) {
return CryptoJS.HmacSHA256(message, secret).toString(CryptoJS.enc.Base64);
}
}
But when I try to include './lib/hmac256-enc64'; (CryptoJS) as a dependency, I encounter a runtime error message that says:
detected as register but didn't execute.
I am puzzled about how to properly include a JS file as a dependency in my EncryptionService. Any suggestions or solutions would be appreciated!