【问题标题】:@ngx-share share button does not work in angular 6@ngx-share 分享按钮在 Angular 6 中不起作用
【发布时间】: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';,然后我将HttpClientModuleShareModule 放入我的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 的说明看起来相同。我在这里想念什么?谢谢

【问题讨论】:

标签: angular angular6 ngx-share


【解决方案1】:
npm install --save @angular/cdk@6
npm install --save @ngx-share/core@6

【讨论】:

    猜你喜欢
    • 2018-10-20
    • 2021-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多