【发布时间】:2019-05-22 19:58:06
【问题描述】:
我在我的 angular 6 项目中使用 Facebook 分享按钮,发现 here 。这应该是“使用 [shareButton] 指令将任何元素转换为共享按钮。”。
按照说明,我做
npm i -S @ngx-share/core @angular/cdk
没有错误
在我的app.module.ts 中,我使用import { ShareModule } from '@ngx-share/core';,然后我将HttpClientModule 和ShareModule 放入我的Imports 中。
然后我把这个按钮放在我的模板<button shareButton="facebook">Share</button>中。这里没有错误。
但是如果我再次ng serve,我会得到
ERROR in node_modules/@ngx-share/core/lib/share.service.d.ts(12,26): error TS1005: ';' expected.
node_modules/@ngx-share/core/lib/share.service.d.ts(13,5): error TS1128: Declaration or statement expected.
node_modules/@ngx-share/core/lib/share.service.d.ts(14,21): error TS1005: ',' expected.
node_modules/@ngx-share/core/lib/share.service.d.ts(14,42): error TS1005: ';' expected.
node_modules/@ngx-share/core/lib/share.service.d.ts(14,48): error TS1109: Expression expected.
node_modules/@ngx-share/core/lib/share.service.d.ts(15,1): error TS1128: Declaration or statement expected.
我在这里缺少什么?我怎样才能使它适用于 angular 6 ?角度 6 的说明看起来相同。我在这里想念什么?谢谢
【问题讨论】:
-
请查看此解决方案是否对您有帮助:stackoverflow.com/a/46399668/1727357
标签: angular angular6 ngx-share