I have come across this specific template
<script type="text/ng-template" id="template">
<span class="count-container">
<span >{{count}}</span>
</span>
</script>
and it is being included multiple times with varying ng-init
attributes like so
<span ng-include="'template'" ng-init="count=$ctrl.getTotalCount()"></span>
<span ng-include="'template'" ng-init="count=$ctrl.tabs[0].errorCount"></span>
Initially, everything functions as expected upon the first load. However, when values within the component are updated, these changes are not reflected where the template is inserted. It seems to be related to how the ng-init
directive operates, since it performs correctly on initial load.
Given this situation, what alternative approach should be utilized in order for the values to update within the template?