This question is old, but my answer may help other people, I recently ran into this problem.
To interpolate the values ββneeded to complete the scope. apply:
var template = angular.element('<div>' + $templateCache.get('ratesPopover') + '</div>'), popover = $compile(template)(scope); scope.$apply(function () {
If you are already in the $ digest loop, then calling $ apply will throw an error, in which case you just need to wait until the digest loop ends:
var template = angular.element('<div>' + $templateCache.get('ratesPopover') + '</div>'), popover = $compile(template)(scope); $timeout(function () {
source share