Skip to content

Commit

Permalink
Fixed the examples & added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Cardenas committed Sep 26, 2014
1 parent 08d5717 commit 507d306
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
7 changes: 5 additions & 2 deletions examples/index.html
Expand Up @@ -9,7 +9,10 @@
<script src="ng-switchery-sample.js"></script>
</head>
<body ng-app="NgSwitcherySample">
<input type="checkbox" class="js-switch" ui-switch checked />
<input type="checkbox" class="js-switch" ui-switch="{color: '#E43B11', secondaryColor: '#F89279'}" checked />
<div ng-controller="SwitchController">
<label>Basic:</label> <input type="checkbox" ng-model="switches.basic" class="js-switch" ui-switch /> {{ switches.basic ? "On" : "Off" }}<br>
<label>Custom:</label> <input type="checkbox" ng-model="switches.custom" class="js-switch" ui-switch="{color: '#E43B11', secondaryColor: '#F89279'}" /> {{ switches.custom ? "On" : "Off" }} <br>
<label>Disabled:</label> <input type="checkbox" ng-disabled="true" ng-model="switches.basic" class="js-switch" ui-switch /> {{ switches.basic ? "On" : "Off" }}<br>
</div>
</body>
</html>
8 changes: 7 additions & 1 deletion examples/ng-switchery-sample.js
@@ -1,3 +1,9 @@
'use strict';

var sampleApp = angular.module('NgSwitcherySample', ['NgSwitchery']);
var sampleApp = angular.module('NgSwitcherySample', ['NgSwitchery']);
sampleApp.controller('SwitchController', ['$scope', function SwitchController($scope){
$scope.switches = {
basic: true,
custom: false
}
}]);
2 changes: 1 addition & 1 deletion src/ng-switchery.js
Expand Up @@ -10,12 +10,12 @@ angular.module('NgSwitchery', [])
/**
* Initializes the HTML element as a Switchery switch.
*
* @TODO add a way to provide options for Switchery
* $timeout is in place as a workaround to work within angular-ui tabs.
*
* @param scope
* @param elem
* @param attrs
* @param ngModel
*/
function linkSwitchery(scope, elem, attrs, ngModel) {
if(!ngModel) return false;
Expand Down

0 comments on commit 507d306

Please sign in to comment.