openmrs/openmrs-contrib-modulus-ui — pull request #12 by elliottwilliams (2014-07-30 14:39:42+00:00)
Title: MOD-19: Progress Bar / Loading Animation

I've added a small progress bar globally across Modulus UI, which is used to indicate loading status (especially helpful on slower connections). It's using [ngProgress lite](http://labs.voronianski.com/ngprogress-lite.js/), and is in the same style as the progress bar on YouTube, Medium, Chrome on mobile devices, etc.

Tasks can be created for any ongoing process using the `ProgressTask` API. Tasks for Restangular methods and application state changes are handled automatically by the `Progress` service.

## API Usage

The API is centered around `ProgressTask` objects. Each task has a status; the progress bar is displayed whenever there are tasks that have an incomplete status.

Create a new task with the following syntax:
```js
var task = new ProgressTask({
name: 'internal task description, for example the URL being loaded',
timeout: true // defaults to true, can be a boolean or the number of milliseconds before the task times out
});
```

Then call `task.resolve()` when the task has completed, or `task.reject()` if the task failed. By default, the task will time out after 15 seconds.