最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to import crypto-js in Ionic 4 - Stack Overflow

programmeradmin2浏览0评论

I used following npm mand to install

npm install crypto-js

After installing i imported

import CryptoJS from 'crypto-js';

But i am not getting any when i type Crypto. i dont get any IntelliSense. I have read on some of the posts which says that i need to add

npm install --save @types/crypto-js

Tried that as well but then i start getting the error on import statement

I will appreciate if someone can guide me what are the steps i need to follow to make this work.

I used following npm mand to install

npm install crypto-js

After installing i imported

import CryptoJS from 'crypto-js';

But i am not getting any when i type Crypto. i dont get any IntelliSense. I have read on some of the posts which says that i need to add

npm install --save @types/crypto-js

Tried that as well but then i start getting the error on import statement

I will appreciate if someone can guide me what are the steps i need to follow to make this work.

Share Improve this question edited Sep 6, 2018 at 8:42 Phonolog 6,5313 gold badges39 silver badges65 bronze badges asked Sep 6, 2018 at 7:06 Muhammad OmaisMuhammad Omais 3291 gold badge4 silver badges12 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

You need to import like this:

import * as CryptoJS from 'crypto-js';
发布评论

评论列表(0)

  1. 暂无评论