Imagine I have this specific directive:
angular
.module('app.widgets')
.directive('myCalendarRange', myCalendarRange);
function myCalendarRange () {
var directive = {
link: link,
templateUrl: '/template/is/located/here.html',
restrict: 'EA'
};
return directive;
function link(scope, element, attrs) {
/* */
}
}
Is there a way to display a loading gif while Angular fetches the template?
UPDATE: I am also looking for a solution that can be applied to views. For instance, when a user navigates to the products page, I want to show the loading animation while angular retrieves the products.html
$routeProvider
.when('/Products', {
templateUrl: 'products.html',
controller: 'productsController',
});