$scope.$apply from ngProgress.color is interfering with $templateCache service, when called from angular.module().run method
Here's a sample of run() method
angular
.module('portal', dependencies)
.run(['$rootScope', '$http', 'ngProgress', 'NotifyService', function($rootScope, $http, ngProgress, Notify) {
ngProgress.color('#66afda');
$rootScope.pendingRequests = $http.pendingRequests;
$rootScope.$watch('pendingRequests', function(requests) {
ngProgress[requests.length !== 0 ? 'start' : 'complete']();
}, true);
$rootScope.$on('$routeChangeError', function() { Notify.error('An error occured when trying to change the current route!'); })
}]);
and here's a sample of routes configuration
$routeProvider
.when('/application-:appId', {})
.when('/application-:appId/:portalViewId/:viewType-:viewId', {
controller: 'PortalViewCtrl',
reloadOnSearch: false,
templateUrl: function($routeParams) {
var viewType = $routeParams.viewType;
return (viewType && portalViewTypes.indexOf(viewType) > -1) && 'portal/portal-views/' + viewType + '/' + viewType + '-view.html';
}
})
.otherwise({redirectTo: '/'});
We're using ngTemplates Grunt plugin to check get all the templates and put them into $templateCache service.
Please note that all the template are included, the paths are correct within this service, everything works ok either by removing the ngProgress.color('#66afda'); line, or commenting out the line where the scope is manually applied (from ngProgress code).
Hey, thanks for reporting the issue!
Is it possible for you to setup a demo plnkr.co where the issue is happening to make it a bit easier to debug?
Thanks.
Getting the same issue in pretty much the same conditions.
I've traced the cause to inside the color method, to the $scope.$$phase and $scope.$apply calls. But after working on it for a good amount of time, we decided to just !important the background-color from CSS.
Getting exactly the same issue, will use the !important ><.