如何将CryptoJs引入angular的module中

来源:9-1 构建和部署

小资要奋斗

2017-05-04

我想使用cryptojs。对http 内容进行加密传输,我在compoent中引入了cropty的三个必须文件,同时也在angular-cli.json 也倒入了这三个所需文件,但是当我使用的时候却报错了,请问如何解决?

http://szimg.mukewang.com/590a96b800016a3105540388.jpg

http://szimg.mukewang.com/590a9694000162ef08300238.jpg

http://szimg.mukewang.com/590a9694000166d708680102.jpg


报错

http://szimg.mukewang.com/590a969400019bf519940114.jpg

写回答

1回答

JoJo

2017-05-05

额...我没用过这个东西,可以参考下面两个帖子的说明 

http://stackoverflow.com/questions/41038425/how-to-use-cryptojs-with-angular-2-and-typescript-in-webpack-build-environment 

https://github.com/angular/angular-cli/wiki/stories-third-party-lib 

应该是要执行 npm install --save @types/crypto-js

0
0

Angular4.0从入门到实战 打造股票管理网站

Angular新特性,教你熟练使用 Angular 和 Typescript 开发组件式单页应用

2683 学习 · 1361 问题

查看课程