【问题标题】:How to show button depending on the string value in <td> tag如何根据 <td> 标签中的字符串值显示按钮
【发布时间】:2018-12-17 09:34:05
【问题描述】:

我正在制作一个 Angular 项目,我有这个使用 WebAPI 从数据库中获取的数据列表。我想使用表格在我的 html 页面上显示这些详细信息。现在,我必须根据其中一列的值显示 2 个按钮,该列是一个字符串。我尝试使用ngif="{{product.Status}}=="Some string,按钮不起作用!我的组件是写在 typescript 上的。请建议做什么!

【问题讨论】:

  • 我认为这与 C# 或 Asp.NET 无关...

标签: c# html asp.net angular-ngmodel


【解决方案1】:

使用以下代码

{{product.Status=="some String" ? "button 1": "button 2"}}

【讨论】:

    猜你喜欢
    • 2023-02-10
    • 2011-10-10
    • 1970-01-01
    • 2012-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-06
    • 1970-01-01
    相关资源
    最近更新 更多