This commit is contained in:
nixa 2016-09-20 11:36:39 +03:00
parent d70c1f3bf5
commit 43257a6081
8 changed files with 59 additions and 40 deletions

View file

@ -50,12 +50,14 @@
</div>
<div class="inner-content">
<h1>Theme Spinner</h1>
<div class="subHeader"></div><p>Theme Spinner <code>BaThemeSpinner</code> is a small service helper allowing you to show a preloader spinner while executing some long-running tasks.
Same spinner you can see after reloading a page - it is shown while application is initializing Anuglar 2 and loading charts and&nbsp;images.</p>
<p>The usage interface in quite simple, there are two public methods: <code>show</code> and <code>hide</code>.</p>
<div class="subHeader"></div><p>Theme Spinner <code>BaThemeSpinner</code> is a small service helper allowing you to show a preloader spinner while
executing some long-running tasks.
This is the same spinner you can see after reloading a page - it is shown while the application is initializing Angular 2 and loading charts and&nbsp;images.</p>
<p>The user interface in quite simple: there are two public methods: <code>show</code> and <code>hide</code>.</p>
<p>Theme Spinner comes with another small helper called <code>BaThemePreloader</code>.
This service globally integrated into the application and connected to the&nbsp;spinner.</p>
<p>You can register any promise in any part of the application so that the spinner will be hidden only after your promise is completed&nbsp;(resolved).</p>
This service is globally integrated into the application and connected to the&nbsp;spinner.</p>
<p>You can register any promise in any part of the application so that the spinner will be
hidden only after your promise is completed&nbsp;(resolved).</p>
<p>You can find an example of usage inside of the <code>app.component.ts</code> file.
Here we are registering a loader (<code>this._imageLoader.load</code> just returns a <code>Promise</code>) which loads a background&nbsp;image:</p>
<pre><code class="lang-javascript"> BaThemePreloader.registerLoader(<span class="keyword">this</span>._imageLoader.load(layoutPaths.images.root + <span class="string">'blur-bg-mobile.jpg'</span>));