diff --git a/angular-ui-switch.js b/angular-ui-switch.js index 9a6b591..8b8d48f 100644 --- a/angular-ui-switch.js +++ b/angular-ui-switch.js @@ -9,7 +9,7 @@ angular.module('uiSwitch', []) var html = ''; html += ''+e.on+"":"",s+=e.off?''+e.off+"":" ",s+=""}}}); \ No newline at end of file +angular.module("uiSwitch",[]).directive("switch",function(){return{restrict:"AE",replace:!0,transclude:!0,template:function(a,b){var c="";return c+="'+b.on+"":"",c+=b.off?''+b.off+"":" ",c+=""}}}); \ No newline at end of file diff --git a/example/app.js b/example/app.js index 3d12135..e915dec 100644 --- a/example/app.js +++ b/example/app.js @@ -2,6 +2,7 @@ angular.module('app', ['uiSwitch']) .controller('MyController', function($scope) { $scope.enabled = true; + $scope.enabledWithArguments = true; $scope.onOff = true; $scope.yesNo = true; $scope.disabled = true; @@ -10,4 +11,8 @@ angular.module('app', ['uiSwitch']) $scope.changeCallback = function() { console.log('This is the state of my model ' + $scope.enabled); }; + + $scope.changeCallbackWithArguments = function(arg) { + console.log('This is the state of my model ' + $scope.enabledWithArguments + '\nValue of passed argument is "' + arg.someArgument + '"' + "\n"); + }; }); diff --git a/example/index.html b/example/index.html index 6adb029..b683697 100644 --- a/example/index.html +++ b/example/index.html @@ -19,6 +19,17 @@

Enabled: {{ enabled }}

+ + + +

+ +

+

+ EnabledWithArguments: {{ enabledWithArguments }} +

+ +