html-template
<div class="jumbotron vertical-center app-loading">
<div class="container-fluid">
<div class="row text-center">
<img src="~/Public/release/images/preloader.gif">
</div>
<div class="row text-center">
Application is loading. Please wait...
</div>
</div>
</div>
<div class="container-fluid" id="appContainer" style="display:none;">
<div class="col-xs-12" ng-view></div>
</div>
app-loading directive
define(['directives/directives', 'angular'], function (directives, angular) {
'use strict';
directives.directive("appLoading", [function () {
return ({
link: link,
restrict: "C"
});
function link(scope, element, attributes) {
element.remove();
scope = element = attributes = null;
angular.element('#appContainer').show();
}
}]);
});
This solves our problem. Once AngularJS fully bootstraps on our application the appLoading directive is being executed, preloader hidden and contents of the app from ng-view displayed (could be a controller or something else).
No comments:
Post a Comment