I have searched through multiple topics on stackoverflow regarding this error, but I still can't grasp the issue in my particular scenario.
Here is the template I am using:
<div class="progress">
<div class="progress-bar"
data-toggle="tooltip"
title="Parts offertes : {{ '{{ gift.gived_parts}}' }} / {{ '{{ gift.number_of_parts }}' }}"
data-bar="gived"
>
<span ng-class="{true:'op7', false:''}[gift.percent_done > 0 && gift.percent_done < 20]">
{{ '{{ gift.gived_parts}}' }}
</span>
</div>
<div class="progress-bar progress-bar-danger progress-bar-striped progress-bar-animate active op7"
data-toggle="tooltip"
title="Parts réservées : {{ '{{ gift.total_reserved}}' }} / {{ '{{ gift.number_of_parts }}' }}"
data-bar="reserved">
</div>
In relation to this directive:
app.directive('progressBarD', function() {
return {
restrict: 'E',
templateUrl: rootUrl + '/directive/progressBar',
scope: {
gift: '=gift'
},
link: function ($scope, $elem, attrs) {
var bars = $elem.find(".progress-bar");
bars.each(function() {
var bar = $(this);
var percent = (bar.context.dataset.bar === "gived")
? $scope.gift.percent_done
: $scope.gift.percent_reserved;
if (($().appear) && isMobileDevice === false && (bars.hasClass("no-anim") === false) ) {
bar.appear(function () {
bar.addClass("progress-bar-animate").css("width", percent + "%");
}, {accY: -150} );
} else {
bar.css("width", percent + "%");
}
});
}
};
});
This is how the directive is implemented:
<progress-bar-d gift="gift"></progress-bar-d>
During execution, an error is encountered:
Error: [$compile:ctreq] Controller 'progress', required by directive 'bar', can't be found!
http://errors.angularjs.org/1.3.15/$compile/ctreq?p0=progress&p1=bar
at angular.js:63
at getControllers (angular.js:7583)
at nodeLinkFn (angular.js:7772)
at angular.js:7998
at processQueue (angular.js:13248)
at angular.js:13264
at Scope.$get.Scope.$eval (angular.js:14466)
at Scope.$get.Scope.$digest (angular.js:14282)
at Scope.scopePrototype.$digest (hint.js:1468)
at Scope.$get.Scope.$apply (angular.js:14571)
The link function seems to be functioning correctly on screen initially, but eventually, the span within the first div disappears when gift.percent_done is not equal to 0.
Can you provide an explanation for this Angular error? Is the deletion of the span causing the same issue?