Skip to content

Commit

Permalink
#17 Add an example for Morpheus onClick()
Browse files Browse the repository at this point in the history
  • Loading branch information
urmilparikh committed Jun 7, 2015
1 parent 2f14764 commit ea78dcb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ angular.module('demoapp', ['ngMdIcons'])
$scope.fill = colors[0];
$scope.size = 48;

$scope.clickIcon = 'thumb_up';
$scope.clickIconMorph = function () {
if ($scope.clickIcon == 'thumb_up')
$scope.clickIcon = 'thumb_down';
else
$scope.clickIcon = 'thumb_up';
}

setInterval(function() {
var random = Math.random();
if (random < 0.2) {
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ <h1>Angular Material Icons v0.4.0</h1>
<div><ng-md-icon icon="{{icon}}" ng-attr-style="fill: {{fill}}" size="48" options='{"duration": 375}'></ng-md-icon><br>options=<br>'{"duration": 375}'<br>(default is 750)</div>
<div><ng-md-icon icon="{{icon}}" ng-attr-style="fill: {{fill}}" size="48" options='{"rotation": "none"}'></ng-md-icon><br>options=<br>'{"rotation": "none"}'<br>(default is clock)</div>
<div><ng-md-icon icon="{{icon}}" ng-attr-style="fill: {{fill}}" size="48" options='{"rotation": "counterclock"}'></ng-md-icon><br>options=<br>'{"rotation": "counterclock"}'</div>
<div><ng-md-icon icon="{{clickIcon}}" ng-attr-style="fill: {{fill}}" size="48" options='{"duration": 375, "rotation": "none"}' ng-click="clickIconMorph()"></ng-md-icon><br>Example:<br>Morph on ng-click</div>
<br>
<br>Note that <code>options</code> attribute is a JSON parse-able string so surround keys with double-quotes.
</li>
Expand Down

0 comments on commit ea78dcb

Please sign in to comment.