0

I am very new to Angular. Here is my angular code :

<tr *ngFor="let data of mf.data">
    <td>
         <div class="aeName">
            <span class="displayName" materialize="tooltip" data-position="top"  data-tooltip="{need to add data.aeName}">{{data.aeName != "" ? data.aeName : data.email}}</span>
         </div>
    </td>
</tr>

If I write directly {{data.aeName}} in data-tooltip attribute the page stops working leaving no any error. Is there any other way to fill data-tooltip with current value in the loop?

Any help is appreciated.

Thanks.

1
  • if this is angularjs related, please dont use the tag angular Commented Jun 13, 2017 at 8:09

1 Answer 1

2
<tr *ngFor="let data of mf.data">
<td>
     <div class="aeName">
        <span class="displayName" materialize="tooltip" data-position="top"  [attr.data-tooltip]="data.aeName != '' ? data.aeName : data.email">{{data.aeName != "" ? data.aeName : data.email}}</span>
     </div>
</td>

this works for me. May be this will help someone.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.