Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Application Loader #44

Open
ghost opened this issue Mar 9, 2016 · 3 comments
Open

Application Loader #44

ghost opened this issue Mar 9, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 9, 2016

I've build my app using your angular-requrejs-seed, now i need add loader because my app takes time to load first time is there any suggestion to add loader while requirejs loading all required files for app ?

@tnajdek
Copy link
Owner

tnajdek commented Mar 9, 2016

Traditional approach would be to add a new css class to <body> (or a div container if you have one). Then that class would be removed once js, in this case angular, has loaded. You could then use that class to display a css spinner, here are some examples of single-element css spinners:

http://projects.lukehaas.me/css-loaders/

Hope this helps

@ghost
Copy link
Author

ghost commented Mar 9, 2016

Yeah i know that @tnajdek but problem is i cannot find angular.bootstrap(document, ['unation']); after event or onComplete event in the app.

@tnajdek
Copy link
Owner

tnajdek commented Mar 9, 2016

You don't need that, you can just use ngCss, use a dedicated directive or put the logic in your index controller.

Try something like this

<div class="loading" ng-class="{'loaded': true}"></div>

then in css .loading for spinner .loading.loaded remove spinner.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant