简体   繁体   中英

How do I bind a value to a TCustomAttribute in Aurelia?

I'm trying to achieve the following result: I have a set of values that are coming from an array which I iterate over in order to populate an HTML table. As well I have an icon that user can hoover-over and can see data in there coming from the array and a translation key coming from translation files.

I want to bind a second argument to the TCustomAttribute in order to display to the user another data that was edited by them.

How do I achieve this in Aurelia?

<template>
<table>
  <thead>
    <th><span>Id</span></th>
    <th><span>Name</span></th>
    <th><span>Description</span></th>
    <th><span>Date</span></th>
  </thead>
  <tbody>
    <tr repeat.for="item of data">
      <td><span>${item.Id}</span></td>
      <td><span>${item.Name}
        <a data-toggle="popover" t="[data-content]pending_name ${data.Name}" data-trigger="hover">
          <i class="fa fa-info-circle"></i>
        </a>
      </span></td>
      <td><span>${item.Description}</span></td>
      <td><span>${item.Date}</span></td>
    </tr>
  </tbody>
</table>
</template>

Take a look at the t-params attribute which allows you to pass in additional parameters. More about that in the official guide http://aurelia.io/docs/plugins/i18n#using-the-plugin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM