我想将 Twitter 时间线嵌入到 Angular 6 应用程序中,但找不到好的解决方案。这是我尝试过的:
ngx-twitter-timeline
包裹。我收到这个警告是因为我使用的是 Angular 6 和 RxJS 6,所以我卸载了它:ng4-twitter-timeline
包裹。它似乎有严重的漏洞:我怎么能得到它?提前致谢,
最佳答案
您不需要安装任何软件包:
index.html :
<head>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</head>
app.component.html :
<a class="twitter-timeline" href="https://twitter.com/TwitterDev?ref_src=twsrc%5Etfw">
Tweets by TwitterDev
</a>
app.component.ts :
ngAfterViewInit(): void {
(<any>window).twttr.widgets.load();
}
来源:https://developer.twitter.com/en/docs/twitter-for-websites/timelines/overview.html
关于angular - 如何在 Angular 6 应用程序中嵌入 Twitter 时间线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50586799/