【问题标题】:Variable within an share button, ionic 3共享按钮内的变量,离子 3
【发布时间】:2019-03-25 01:57:06
【问题描述】:

我正在尝试将{{data.title}} 之类的变量放在按钮内

<button onclick = "window.plugins.socialsharing.share (data.title)"> message only </ button>

但我不知道该怎么做。

知道怎么做吗?

【问题讨论】:

  • 你能详细说明你想达到什么目标吗?将 data.title 传递给方法?你能分享你的模板的完整代码,包括 ngFor

标签: json ionic-framework ionic3


【解决方案1】:

试试这个方法:

<button (click)="window.plugins.socialsharing.share(data.title)"> message only </button>

另外,最好在 ts 文件中编写一个已经调用插件的方法:

<button (click)="shareClicked(data.title)"> message only </button>

在您的 TS 中:

shareClicked(title) {
    window.plugins.socialsharing.share(title)
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-09-08
    • 2020-06-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-20
    相关资源
    最近更新 更多