angular - Angular 5 上的 LINE 共享插件
问题描述
Angular5新手在这里。在我的博客应用程序中,我想在 LINE 上分享一篇文章。我已经浏览了LINE 官方文档,但是在构建过程中它失败了。
然后,我尝试了 NG2-social-share,但收到如下错误:
ng2-social-share.d.ts 中的意外值“Ceiboshare”
任何指针都会有很大帮助。
解决方案
CeiboShare package
最多支持 Angular 2 版本。由于此软件包未针对最新版本的 Angular 进行更新,因此我们手动进行了社交分享。这是我的component.html
组件.ts
facebookShareUrl = 'https://www.facebook.com/sharer/sharer.php?u=&t=';
shareWithLine() {
console.log(document.URL);
window.open('https://lineit.line.me/share/ui?url=' + encodeURIComponent(document.URL) + '&t=' + encodeURIComponent(document.URL));
return false;
}
推荐阅读
- r - 如何在数据框列中存储“米上标减 3”
- android - 如何忽略 Parent Layout 的背景
- java - PreferenceFragmentCompat 未显示 XML 中的所有首选项
- c# - 如何在c#中的每批请求中保持5秒的间隔
- shell - 通过应用程序安装执行命令时出现“grep:写入错误:管道损坏”
- node.js - 如何在 Puppeteer 的请求中通过 post 添加数据?
- visual-studio-code - 如何阻止 VScode 在我的源文件夹中创建 .vscode 文件夹
- sql - 之前的累积和,之后的累积和
- python - 有没有办法在使用 ** 运算符时即时对变量进行类型转换?
- python - 有什么方法可以使用python以递增顺序在文件中添加数据