I know this question is old, but since there is no accepted or clear answer, I am also trying to solve it.
The lack of a permission state for each application caused me several times, and this is the solution I finally came up with: http://jsfiddle.net/gabrielcatalin/cvyq0oys/
In short, I created the Angular Enhancer module (decorator), which supports 2 more methods: enable () and ready () . An AngularEnhancer snippet should only be loaded after angular.js is loaded and before implementation, for example:
<script type="text/javascript" src="angular.js"> <script type="text/javascript" src="angularEnhancer.js"> <script type="text/javascript" src="main.js">
Here's what the implementation will look like:
angular.module('myApp', []) .ready(function() { alert('The app is ready to be used!'); }) .resolve(['$q', function ($q) {
and html:
<body> <div ng-if="!appReady" class="splash-screen">This is just the splash screen!</div> <div ng-if="appReady">Welcome to the app!</div> <script> angular.element(document).ready(function() { angular.bootstrap(document, ['myApp']); }); </script> </body>
Hope to see some comments from you guys!
Gabriel C. Troia
source share