Import crypto-js in an angular 2 project (created with angular-cli)
This may help you:
$ npm install crypto-js --save
$ npm install @types/crypto-js --save-dev
then:
import * as CryptoJS from 'crypto-js';
or
import CryptoJS = require('crypto-js');
You can try following as a solution:
1. npm install --save @types/crypto-js
2. import { AES } from "crypto-js";
3. AES.encrypt('my message', 'secret key');