1

How can using "uib-tooltip-template" with ng-repeat of AngularJS ? There is a methode to add templates dynamicly because I tried it but it does not work !!

<li ng-repeat="item in items" class="cursor-element">
  <a tooltip-trigger="'click'"
     tooltip-placement="left"
     uib-tooltip-template="'template1.html'"
     tooltip-is-open="item.isOpen"
     tooltip-class="customized">
  </a>
</li>

<script type="text/ng-template" id="template1.html">
  <div class="row action-menu">
  <h3>test </h3>
</script>
<script type="text/ng-template" id="template2.html">
  <div class="row action-menu">
  <h3>test </h3>
</script>
 .
 .
 .
<script type="text/ng-template" id="templateN.html">
  <div class="row action-menu">
  <h3>test </h3>
</script>
1
  • provide a jsfiddle or codepen with a working example for checking Commented Aug 8, 2017 at 15:08

1 Answer 1

1

If you want to add template id dynamically based on $index/ some specific property from your item ojbect

uib-tooltip-template="'template'+ $index +'.html'"
//OR
uib-tooltip-template="'template'+ item.TypeId +'.html'"
Sign up to request clarification or add additional context in comments.

1 Comment

@MohammedAkdim did you checked this?

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.