我正在尝试将typeform嵌入到angular 9项目中。
我已经使用NPM安装了typeform,我提到了这个https://developer.typeform.com/embed/
npm install --save @typeform/embed
然后在我的component.ts文件中,我尝试测试它。
import * as typeformEmbed from '@typeform/embed';
export class MyComponent {
...
initTypeform() {
console.log(typeformEmbed)
}
}
在我的终端中,我得到了这个错误:
Module not found: Error: Can't resolve 'react' in '/app/node_modules/@typeform/embed/build'
ERROR in ./node_modules/@typeform/embed/build/lib.pure.js
Module not found: Error: Can't resolve 'react-dom' in '/app/node_modules/@typeform/embed/build'
所以我能够通过安装react&对我的Angular 9项目依赖项做出反应。
npm i react
&
npm i react-dom