I have this template
<script type="text/ng-template" id="template">
<span class="count-container">
<span >{{count}}</span>
</span>
</script>
and I am including this multiple times with different ng-init like this
<span ng-include="'template'" ng-init="count=$ctrl.getTotalCount()"></span>
<span ng-include="'template'" ng-init="count=$ctrl.tabs[0].errorCount"></span>
this works fine on the very first load, but when the values are updated in the component, those are not reflected where the template is loaded. I guess it's due to how the ng-init works since it's everything fine on the 1st load.
So what should be used so that the values are updated in the template?
countbeing defined? Is it within or outside the loop of the template?ng-modeltospanwould work.ng-initwithng-template. That should be done with yourng-controller.