forked from angular/material
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(progress-circular): add theming, simplify demo
* Applies `$mdTheming` to the `progressCircular` component. * Simplifies the `progressCircular` demo and adds an example of the dark theme colors. * Removes strict dependency injection in the `progressCircularDirective`. Closes angular#7570. Closes angular#7576.
- Loading branch information
1 parent
31787c0
commit 34035f0
Showing
3 changed files
with
34 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,21 @@ | ||
angular | ||
.module('progressCircularDemo1', ['ngMaterial']) | ||
.controller('AppCtrl', ['$scope', '$interval', | ||
function($scope, $interval) { | ||
var self = this, j= 0, counter = 0; | ||
.controller('AppCtrl', ['$interval', | ||
function($interval) { | ||
var self = this; | ||
|
||
self.showList = [ ]; | ||
self.activated = true; | ||
self.determinateValue = 30; | ||
|
||
/** | ||
* Turn off or on the 5 themed loaders | ||
*/ | ||
self.toggleActivation = function() { | ||
if ( !self.activated ) self.showList = [ ]; | ||
if ( self.activated ) j = counter = 0; | ||
}; | ||
|
||
// Iterate every 100ms, non-stop | ||
// Iterate every 100ms, non-stop and increment | ||
// the Determinate loader. | ||
$interval(function() { | ||
|
||
// Increment the Determinate loader | ||
|
||
self.determinateValue += 1; | ||
if (self.determinateValue > 100) { | ||
self.determinateValue = 30; | ||
} | ||
|
||
// Incrementally start animation the five (5) Indeterminate, | ||
// themed progress circular bars | ||
|
||
if ( (j < 5) && !self.showList[j] && self.activated ) { | ||
self.showList[j] = true; | ||
} | ||
if ( counter++ % 4 === 0 ) j++; | ||
|
||
}, 100, 0, true); | ||
}, 100); | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters